I opened a pipe to a program that reads text input.
This is what I am currently doing
FILE* p = popen("myprogram", "w");
string myBuff;
//write something to myBuff
fprintf(p, "%s\n", myBuff.c_str());
This is what I want to do
p = popen("myprogram", "w");
p << "my text" << endl;
Does Boost have something for this? I would assume this is a frequently encountered problem, how is it usually solved?
boost has the Interprocess library which facilitates communication between processes. They also have in their sandbox, as an unofficial library, the Process library that facilitates inter-process communication using the standard pipes.