Fprintf In C Programwiz Code Example


Example 1: what is fprintf in c

#include<stdio.h> int main() {    int i, x = 4;    char s[20];    FILE *f = fopen("new.txt", "w");    if (f == NULL) {       printf("Could not open file");       return 0;    }    for (i=0; i<x; i++) {       puts("Enter text");       gets(s);       fprintf(f,"%d.%s\n", i, s);    }    fclose(f);    return 0; }

Example 2: what is fprintf in c

int fprintf(FILE *fptr, const char *str, ...);

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable