int system ( const char * command );
Invokes command interpreter to execute a command. Once terminated, the interpreter gives back control to the program returning an int value.
If a command was successfully executed the command interpreter returns an adequate value; generally 0 indicates that the action performed by the command interpreter terminated with no errors.
A return value of -1 indicates an error, and global variable errno is set to one of the following errors:
value description ENOENT Command interpreter not found ENOEXEC Command interpreter is not executable ENOMEM Error allocating memory for the process E2BIG Argument list too big
Defined in ANSI-C.
Return value and possible errno values are system dependent.
/* system example : DIR */
puts ("Trying to execute command DIR");
i = system ("dir");
if (i==-1) puts ("Error executing DIR");
else puts ("Command successfully executed");
atof, strtol, strtoul