reading a character from file using fgetc

 #include <stdio.h>


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


printf("%c\n",fgetc(fptr));
printf("%c\n",fgetc(fptr));
printf("%c\n",fgetc(fptr));
printf("%c\n",fgetc(fptr));
 return 0;
 
}

Comments

Popular posts from this blog

comparing 2 dates using structures

free dynamic memory allocation

prime number