Definition of System I didn't take a closer look, mainly on the execution system command, say the system command, is the command prompt under Windows can execute the command, and corresponds to the terminal name command under Unix/linux;
Example 1;
1 int Main () 2 {3 System ("pause"); 4 System ("dir"); 5 return 0 ; 6 }
As you can see, the result is:
Do not include any header files;
common commands are; (under Windows)
Pause: Suspend execution, commonly used in C + + under the VS write-down at the end of the program to avoid flash;
CLS: Clear screen, that is, clearing the console, the usage can be:
First on the code:
1printf"\t****************************************************\n");2printf"\t* *\n");3printf"\t* 1-SDSDSDSDSD 2-dsadass *\n");4printf"\t* 3-SDSADSADSD 0-hleks *\n");5printf"\t* *\n");6printf"\t****************************************************\n");7 8 intI=0;9scanf"%d",&i);Ten GetChar (); One if(i==1) A { -System"CLS"); -}
, if you enter 2
The result is this:
Enter 1, after the CLS is executed:
Other useful words I will record again;
Finished
About the method of using the system function in C language