Gianni Mariani wrote:
If you executed your program from the std::system function call then
the value is partly returned by the system call. If the return value
from system() is negative then there was an error, otherwise the
lower 8 bits are the lower 8 bits returned from main often termed the
"status".
There is no such requirement for the system() function. From the C99
draft standard:
7.20.4.5 The system function
Synopsis
[#1]
#include <stdlib.h>
int system(const char *string);
Description
[#2] If string is a null pointer, the system function
determines whether the host environment has a command
processor. If string is not a null pointer, the system
function passes the string pointed to by string to that
command processor to be executed in a manner which the
implementation shall document; this might then cause the
program calling system to behave in a non-conforming manner
or to terminate.
Returns
[#3] If the argument is a null pointer, the system function
returns nonzero only if a command processor is available.
If the argument is not a null pointer, and the system
function does return, it returns an implementation-defined
value.
Brian