Print to a File - C

Print to a File

Snippet Code


  
Rate this page :
  [ 0 votes]

#include <stdio.h> int main() { FILE *fp; int rating = 9; if (fp = fopen(<q>e:/abc.txt</q>, <q>w</q>)) { fprintf(fp, <q>WWWn</q>); fprintf(fp, <q>hscripts.comn</q>); fprintf(fp, <q>Rating out of 10 : %d n</q>,rating ); fclose(fp); } else printf(<q>Error opening filen</q>); return 0; }

Tags


Ask Questions

Ask Question