Question: How do I get the following code to compile in C++? I am getting errors: initializing argument 1 of pid_t wait(int*) and: error: invalid conversion
How do I get the following code to compile in C++?
I am getting errors: initializing argument 1 of pid_t wait(int*)
and:
error: invalid conversion from int to int* [-fpermissive]
#include
using namespace std;
int main () {
int val = 5; int pid;
if (pid = fork()) wait(pid); val++; printf("%d ", val); return val;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
