ok so i got a question... again lol big suprise
ok so heres the code i got so far
Code:
//Written By : Andrew Bomstad
//"Day6"
#include<iostream>
#include<ctype.h>
#define cls system("cls");
#define pause system("pause");
using namespace std;
int main()
{
int input;
cout << "enter a digit" << endl;
cin>>input;
cout<<cin;
pause;
if(cin){
cls;
cout << "You Entered The Number: " << input<<endl;
pause;
cls;
main();
}
else{
cls;
cout << "Error! Must Enter A Number" << endl;
pause;
main();}
pause;
main();
}
ok... the next part i have NO idea how to go about....
i want a way to send a error message out, if the user inputs more than one input... like say if they type "3hgh" or somthing i want an error message
so im thinkin... do i need to check the keyboard buffer to see how much input was enterd and then do somthing bout that? i dont know really im confused with it all lol
anyhelp would be great guys
o yeah... im also looking for a way to get out of the Infinite loop you'll get if you hit a "Char" in my program. lol i tried clearing the buffer before sending it back to main.. but it just keeps erroring