B
bhanuprakash
I am trying to use fscanf to read my test file. In my test file i
sometimes have blank lines.
When I try to read using the following format.
fscanf(fp,"%[^\n]\n",temp_str);
If there is any blank line it reads contents from the next line. How do
I read blank into my variable if the line is blank.
Example
Line Number Input
1 Hi
2
3 Smile
In the above scenario if I try to read line number 2 where it is blank
it reads "Smile" into my temp_sttring variable. How do I ensure if
there is a blank line my variable also ends up blank.
sometimes have blank lines.
When I try to read using the following format.
fscanf(fp,"%[^\n]\n",temp_str);
If there is any blank line it reads contents from the next line. How do
I read blank into my variable if the line is blank.
Example
Line Number Input
1 Hi
2
3 Smile
In the above scenario if I try to read line number 2 where it is blank
it reads "Smile" into my temp_sttring variable. How do I ensure if
there is a blank line my variable also ends up blank.