I have the code below, but I need that exit(status)
return a float but WEXITSTATUS
doesn't receive a float cause status must be int, so what's the solution please?
scanf("%f%f",&f,&g);
P = fork();
if(P == 0){
printf("\nje suis le fils multiplication: PID = %d\n", getpid() );
printf("mon pere: PID = %d\n", getppid() );
resultat2 = f * g;
exit(resultat2);
}else if(P < 0){
printf("FORK a echoue\t");
exit(EXIT_FAILURE);
}else{
printf("\nje suis le pere : PID = %d\n", getpid() );
printf("mon fils: PID = %d\n", P );
P = wait(&status);
if(WIFEXITED(status))
printf("le produit = %d \n", WEXITSTATUS(status));
}