You are not logged in.
Pages: 1
Hi, Gurus,
I'm trying to send a string ex) "Can you hear me?"
to other process by message queue in infinite loop.
However, I have a problem to work it right.
Will you please look at attached zip file and
tell me what's wrong with my code?
They are simple so it won't bother you much.
Thanks in advance.
Offline
I know very little about those ancient SysV IPC methods, and never use them for
anything myself... (There are so many superior methods of IPC, why on Earth would
you use something with such an ugly and lame interface?)
However, THIS is clearly wrong:
if(key = ftok("test1.cpp", 'Z') == -1)
You need surrounding parenthesis around the assignment... As it is, you're assigning
to "key" the boolean result of that comparison against -1; ie: either 0 or 1, depending on
whether or not the return from ftok() is -1...
Offline
Pages: 1