For example, a.out program:
int main()
{
return 0x10;
}
B.out program:
int main()
{
if(system("./a.out") == 0x10)
return 0;
else
return -1;
}
According to cppreference , the return value system()is implementation dependent. Thus, an attempt to b.out is obviously erroneous.
In the above example, how can I get 0x10instead of an undefined value? If a system call is not the right tool, what is the right way to do this?
source
share