Basically i am trying to run a program like
cat file | ./cprogram.c
I read in the lines of the file using gets.
The line is of the form( seperated by tabs)
word word word word
The no of words are a max of 5.
What i would like to do is to assign these values to specific variables, which i am doing using sscanf, but
when one of the values is absent, the wrong values will be assigned to the variables.
sscanf(line,"%s\t%s\t%s\t%s\t%s", str1, str2, str3, str4, str5);
Any help appreciated.