c - Retrieving return code from child process using wait()? -
i have 2 files "prime.c" , "singleprime.c" , inside of singleprime.c trying create child morphs "isprime.exe" executable made out of "prime.c". want return number isprime.exe either 1 or 0 depending on if input number prime or not , store in childnum inside of main() function of "singleprime.c" can print terminal whether it's prime number or not based on 1 or 0 returned "isprime.exe". below 2 files: prime.c: /* file isprime.c purpose: program checks if given number prime number input: number - positive int entered via command line parameters. example isprime 1234 output: 0 - if input number not prime number 1 - if input number prime number 2 - if command line parameter not correct assumption: program not check if number positive integer */ #include "stdio.h" #include "stdlib.h" #include <unistd.h> #include "prime.h" int main(int argc, char *argv[]) { int i; ...