Untitled
By: a guest | Sep 5th, 2010 | Syntax:
C++ | Size: 0.34 KB | Hits: 27 | Expires: Never
FILE * pfile = fopen("mitextfile.txt", "r");
int a;
// read one integer from the file
fscanf(pfile, "%d", %a);
// read one string from the integer
char buff[90];
fscanf(pfile, "%s", buff);
fclose(pfile);
FILE * outfile = fopen("othertextfile.txt", "w");
fprintf(outfile, "%s", "hola mundo");
fpritinf(outfile, "the value of a is %d", a);