Input stream into c program -
i have file following values:
12,23 2 90
i have linked list structure has function add values it:
add_value(int x).
my end goal direct file cprog , have values (ints) added structure.
file | cprog
but can't figure out how read each digit, add linked list, , move onto next digit , add too?
thanks
int x, status; while((status=scanf("%d", &x))!=eof){ if(status == 1) add_value(x); else fgetc(stdin);//drop 1 character }
Comments
Post a Comment