#include <stdlib.h>
|
int
system (const char *string); |
If string is a NULL pointer, system will return non-zero to indicate that system is suporrted and zero if it is not supported.
The system function returns the exit status of the child process as returned by process exit reason or -1 if an error occurred when spawning a new process.
#include <stdlib.h> //system #include <stdio.h> //printf int main( void ) { int retVal = -1; printf( "Calling system()...\n" ); /* helloworld.exe is an executable that just prints * "Hello world!" and it should be created before * executing this example code. */ retVal = system("c:\\sys\\bin\\helloworld.exe"); /* Print the return value of system() */ printf( "system() returned: %d", retVal ); return 0; }
Output
Calling system()... system() returned: -1
© 2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. |