writing in a text file using c program

 #include <stdio.h>


int main(){
FILE * fptr;
char c;
fptr=fopen("fputcsample.txt","w");

fputc('A',fptr);
fputc('N',fptr);
fputc('C',fptr);
fputc('H',fptr);
fputc('A',fptr);
fputc('L',fptr);
fclose(fptr);
 return 0;
 

Comments

Popular posts from this blog

snake game Version-2 (using random number)

allocating dynamic memory using calloc

store a table in dynamic array and then change the size of array dynamically to store more numbers