Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Reading from stdin with C

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.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List