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 fprintf

    C fprintf() function passes arguments according to the specified format to the file indicated by the stream. This function is implemented in file-related programs for writing formatted data in any file. This tutorial guides you on how to use the fprintf() function in the C program.

    Syntax:

    int fprintf(FILE *stream, const char *format, ...)

    Example:

    int main (void) 
    {
       FILE *fileName;
       fileName = fopen("anything.txt","r");
       fprintf(fileName, "%s %s %d", "Welcome", "to",  2018);
       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.