Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Interprocess communication using pipe
I am having problems creating a "process race" application.
The following is what I have come up with so far:
A child process#include #include
using namespace std;
int main (int argc, TCHAR *argv)
cout << i;
Main program (excerpt)
*&processPosition[i] = t;
where hPipeLasning is the handle to read from the pipe. Why does this solution not work, I get really weird numbers. My basic idea was that I would use cout to send numbers (long) through the pipe. In the main program I would read the number from the pipe and update a posistion variable (processPosition[i]). What am I doing wrong? Do I have to do something special in the child program?
I would appreciate some help.
0 · ·