scanf stop reading when eol is seen
- by gcc
scanf("%[^\n]\n",A[i]);
/*that reads input line by line; example:first line is stored in A[0]*/
-> but I want read each element of line and send to struct fuction until
the EOL (end of line)
-> explaining: in current line,read one data ,then send to struct funcion
to hold,after then ,in for loop, read next data decide it is float
then send it to function.
when eol is read, then activate next struct.
>question is I want write something in scanf such that I stop read when
i see eol.
can I do
for( ; ; )
{ scanf("...",Sam);
if(Sam=='\n)
break;
}