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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -