Receiving output from a pipe

So I'm trying to make a program that will allow me to type in the command line something such as:

cat inputFile | myProg.exe otherFile1 otherFile2 ...

I know how to use argc and argv in myProg to use the arguments following it, but how do I access the output from the left of the pipe to use as my input for the right? I searched around and am clueless. Thanks in advance!
Last edited on
IIRC the reason it is called a pipe is because the input file gets 'piped' into your program's standard input stream (std::cin).
That helps, but I've run into another problem. How do I read the whole file into a buffer? I know I can use getline to read just one line, but how do I get all of it?

Edit: Nevermind I figure it out. Thanks!
Last edited on
Topic archived. No new replies allowed.