Online visitors

People learning around the world

Online

—

Visitors exploring W3Schools

Online visitors by country Circles show approximate country locations. The country list provides the visitor counts.

Circles represent countries, not exact visitor locations.

Country

Online

Loading country activity…

    C putc

    The putc() function is a C library function, which is used to write a character to a file. This function is used to write a single character to the stream as well as advance the position of the indicator. This tutorial guides you on how to use the putc() function in the C program.

    Syntax:

    int putc( int c, FILE * stream );

    Example:

    int main (void)
    {
        FILE * fileName;
        char ch;
        fileName = fopen("anything.txt","wt");
        for (ch = 'D' ; ch <= 'S' ; ch++) {
            putc (ch , fileName);
        }
        fclose (fileName);
        return 0;
    }


    Found This Page Useful? Share It!
    Get the Latest Tutorials and Updates
    Join us on Telegram

    Notifications

    Updates are enabled for this browser.

    Receive new tutorials, articles and learning resources. You can turn updates off anytime.