Read OnLine C- Program Example

10_FILE HANDLING
PRAC 1  
//wap to write a file
#include <stdio.h>
void main()
{
FILE *fp;
clrscr();
fp = fopen("file.txt","w");
/*Create a file and add text*/
fprintf(fp,"%s","This is just an example"); /*writes data to the file*/
fclose(fp); /*done!*/
getch();
}
Previous Next
Download