hello
i'm writing a program in c++ and i'm using linux.
i use fork() in order to create a process and then i want to wait for the child process
to finish so its something like that:
pid=fork();
if(pid<0)
{
cerr << "Failed to fork" << endl;
exit(1);
}
if(pid==0){
/*do what you have to do*/
exit(0);
}
int status;
wait(&status);
the thing is that it doesnt accept this syntax of wait()
which is really strange as in C works fine.
can anybody tell me whats wrong?