Name: Anonymous 2009-05-20 16:45
Okay, it's not as easy as you think.
I want to do something like this:
ls -lh | ./myProg
Now, how can I read the data from stdin in my program?
I tried fgets, getline and fscanf. None of those work - they either crash the program or just get into the interactive mode (where the program's waiting for user input) which I do not want.
Halp.
I want to do something like this:
ls -lh | ./myProg
Now, how can I read the data from stdin in my program?
I tried fgets, getline and fscanf. None of those work - they either crash the program or just get into the interactive mode (where the program's waiting for user input) which I do not want.
Halp.