I need to read and print data from a file. I wrote the program like below,
#include #include int main(void) { char item[9
In your code:
while(fscanf(fp,"%s %c",item,&status) == 1)
why 1 and not 2? The scanf functions return the number of objects read.