I hear alot of people saying not use:
system("pause");
system("cls");
system("title");
I think you get what I mean, so I'm trying to make functions that will replace all of these, and for my first installment I'm going to show you how to replace system("pause");. Here is what I have.
#include <iostream>
#include <conio.h>
void PrsAnyKey2Cont ();
char KeyStroke;
void PrsAnyKey2Cont ()
{
cout << "Press any key to continue . . .\n";
KeyStroke = getch ();
KeyStroke = getch ();
switch (KeyStroke)
{
default :
break;
}
}
int main ()
{
cout << "Hello world!!" << endl;
PrsAnyKey2Cont ();
return 0;
}
There are probably a million things wrong with this right now and I plan on making a better function that will allow you to set the time of the pause and wether or not the user even needs to input a key to continue. Thanks for any constructive critisism!! ^_^