PDA

View Full Version : Close function confusion



ToddAtWSU
4th December 2008, 14:00
I have a QWidget which inside it creates a process using fork. I use the new process to run a secondary executable and to communicate between the two processes I create some pipes. I am making the pipes so the communication can only go one-way, that way I can pass into the secondary applications input from my main application since I cannot write to stdin to answer its inputs.

Anyways, the problem I am having is I am trying to close of some of the ends of the pipes, but when I call the close function with its argument
close( int ) the compiler doesn't let me compile because it says QWidget::close doesn't take any arguments. The close I am trying to use is located in unistd.h. I have tried


std::close( int );
unistd::close( int );
but std does not contain close and unistd does not appear to have a namespace or whatever its called. So how can I get around the confusion of which close I want to use. Thanks for your help and input!

caduel
4th December 2008, 14:45
use

::close(int)

ToddAtWSU
4th December 2008, 17:30
Thanks I will give that a try. Didn't know I could just put :: at the front.