C error - wait()

c, wait

Solution

If you check the documentation for `wait`, what it takes as parameter is a pointer to int where to set the status. Since this is homework, I'll let you conclude the solution yourself.

Problem

I write a program using memory segments but the problem is my wait() is throwing me an error error: ``` ks.c:24:2: error: incompatible type for argument 1 of ‘wait’ /usr/include/x86_64-linux-gnu/sys/wait.h:116:16: note: expected ‘__WAIT_STATUS’ but argument is of type ‘int’ s.c:13:6: warning: unused variable ‘w’ [-Wunused-variable] ``` Code line is simple `wait(1);` and i have includeted all neccesarry ehaders for the project why do i get that error, since it should work like this... imports ``` #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> #include <sys/wait.h> #include <errno.h> #include "st.h" ```

Original source