I have 2 Programs. One program will start the other and should block for input, read the input, block again and so on:
But I only get the input, when all the cout lines are written. What do I do wrong?
int main(int argc, char **argv)
{
FILE *read_fp;
char buffer[BUFSIZ+1];
stdout is (usually) buffered by default. Try setvbuf(stdout,NULL,_IONBF,0); before you do any output to stdout. Or just do fflush(stdout); after outputting a line.
EDIT: Just remembered that std::endl will also flush the stream - so cout << "Hallo " << endl; should do the trick.