V
vashwath
Hi all,
To test the return value of system I wrote 2 programs which are shown
below.
Program 1:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int ret;
ret = system("./TEST");
printf("Return value = %d\n",ret);
return ret;
}
Program 2:
int main()
{
return 50;
}
The executable name of program2 is TEST. I thought system in Program1
will return whatever program2 will return, but It didn't. What
exactly system will return?What should I do if I want to get the exact
return value of program2?
Thanks
To test the return value of system I wrote 2 programs which are shown
below.
Program 1:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int ret;
ret = system("./TEST");
printf("Return value = %d\n",ret);
return ret;
}
Program 2:
int main()
{
return 50;
}
The executable name of program2 is TEST. I thought system in Program1
will return whatever program2 will return, but It didn't. What
exactly system will return?What should I do if I want to get the exact
return value of program2?
Thanks