BCS-1A

Tuesday, January 31, 2012

system("PAUSE");


system("PAUSE");

The system("PAUSE") function pauses the program at where it defined and requires user input to continue.

#include <iostream>
using namespace std;
int main()
{
 cout<<"Hello World"<<endl;
 system("PAUSE");
 return 0;
}

Commenting

The system("PAUSE") will print out Press any key to continue. . . We can remove this message using >>NULL

#include <iostream>
using namespace std;
int main()
{
 cout<<"Hello World"<<endl;
 system("PAUSE>>NULL");
 return 0;
}
Now the >>NULL will remove the Press any key to continue. . . message. . .

Happy Coding

No comments:

Post a Comment