HI , I am coding in C++ on linux platform. what system command will return , when the string entered as argument is not a proper shell command. when I given system("abc") , it is returning 256 . I know that if it returns -1 means that system failed to run . what 256 indicates means what positive integer return values mean ? Regards, Sharath
WEXITSTATUS-Obtain exit status of a child process This macro queries the child termination status provided by the wait and waitpid functions. If the WIFEXITED macro indicates that the child process exited normally, the WEXITSTATUS macro returns the exit code specified by the child process. status The status field that was filled in by the wait or waitpid function. Normal return The WEXITSTATUS macro is always successful. If the WIFEXITED macro indicates that the child process exited normally, the WEXITSTATUS macro returns the exit code specified by the child. If the WIFEXITED macro indicates that the child process did not exit normally, the value returned by the WEXITSTATUS macro has no meaning.