Executable call into an executable: can I pass streams to it?

Pages: 12
That's true, I always leave some room for interpertation in the beginners section because let's face it how often do people here really know what they want?

But in that case you are correct, it would not be possible.
"/dev/stdin" could make it read from the standard input. So you could redirect the input of the child, and make a pipe1... (¿how?)
However if you can don't make that communication. hello.cpp should have the definition of a cat function that receives a reference of a stream. Another function should create that stream in base to a filename.
That way you have function calls instead of creation of process, and you can adapt them more easily.

¿But why can't we threat the RAM as a file?2, moreover there are functions like fmemopen (i/o) and open_memstream (o) that works with FILE pointers...

1 But you still need to output...

2¿Can an stringstream be constructed with a char pointer (in a safe way)?
Last edited on
Topic archived. No new replies allowed.
Pages: 12