hi

can anyone tell me what do we mean by:

system( "PAUSE" );

and

system( "CLS" );


in C++

thanks

Recommended Answers

hi

can anyone tell me what do we mean by:

system( "PAUSE" );

and

system( "CLS" );


in C++

thanks

system("PAUSE"); the program waits for you to enter a key
system("CLS"); clears the console or command line terminal

both of …

Jump to Post

See this about system("pause"); system("cls"); is conceptually similar.

Jump to Post

All 5 Replies

hi

can anyone tell me what do we mean by:

system( "PAUSE" );

and

system( "CLS" );


in C++

thanks

system("PAUSE"); the program waits for you to enter a key
system("CLS"); clears the console or command line terminal

both of makes your program not portable since is operating system
depended

See this about system("pause"); system("cls"); is conceptually similar.

thank u guys!!!

use

getchar(); 
or
cin.get();

instead of system("pause");

Well, the System("pause"); actually a function to the main windows shell, which calls pause.exe, and thereby pauses your program. And just to let you know, the System("PAUSE") method is a bad way of pause your applications...

A good alternative is at:
http://cpp.codenewbie.com/articles/cpp/1437/systemPAUSE-Page_1.html


As for System("CLS") function, it clcears your console applications screen. Basically erasing any user or application genereated output on the screen.

Please let me know if this helps you.

Thank,
Lance Wassing

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.