April 24, 2013

System( ) Function in stdlib.h Library

04:09 Posted by Unknown , No comments
The C library function system() passes the command name or program name specified by a command to the host environment to be executed by the command processor. After the execution of the command it returns a value depending on the status of the execution. 

To use this function,
 int system( const  char *command )    
         When you call this function, It  will invoke the command processor to execute a command. If the command execution is terminated the processor will trasnfer the control back to the program that has called the system command.

                 String containing name of system command or requested variable. 

Return Value:
            It will return an integer value, but the interpretation of that is system dependant. So, on different systems it gets interpreted differently. If an error occured in the program execution, '-1' is returned, Ootherwise it returns the status of command.

Click here to know how you can restart your computer using system function. 

As, always, Have a happy reading and Stay Awesome !
Follow our blog posts @ Follow. So that you won't miss any interesting post and also to be the first to know the answers to many interesting questions.
Follow us on our Facebook  page @ Fre Blogg 
Head over to my You Tube channel for some interesting tutorials @ You Tube


Post a comment

Please Enter your comment here......