Transfering data between two programs

Hi
Do you know how I can transfer data between the two programs in C++?
Shell:
Code:
chmod +x program1
chmod +x program2
program1 | program2
Code:
char data = "q";
In code program1:
Code:
cout << data;
In code program2:
Code:
cin >> data;
Is this the way will be sent to a variable of type char ?
 
crucifix said:
Hi
Do you know how I can transfer data between the two programs in C++?
Shell:
Code:
chmod +x program1
chmod +x program2
program1 | program2
Code:
char data = "q";
In code program1:
Code:
cout << data;
In code program2:
Code:
cin >> data;
Is this the way will be sent to a variable of type char ?


I think it's OK as std::cout and std::cin have the same effect with echo and read. Pipe can be used for both.
 
Back
Top