The system() function (declared in
int main(){ int stat = system("winword.exe"); //launch Word and wait // until the user closes it}
When the system() call returns, the value assigned to stat is the exit code of the shell process that in turn launches Word, not Word