Cause I'm the only one who's Insomniac.
Anyways, so yeah. Hai guys, if you know me, then I love you. If you don't well, we can get to know each other. However,

, I was reading up on C, yes C, not C++, because I wanna learn C before C++....again.
Okay, so I'm just starting again, I only did about the intro, yeah it's things I know. But a question came to mind.
You know how
getchar() or
cin.get() is used to wait for a char input from the user before it closes? I was wondering if it was possible to use
getchar() or
cin.get() in an
if statement.
As in, it would ask the user for input, and then if the user inputs a specific character, the program then instead of closing, would skip to the if statement? ._.;
Something like this is what I'm trying to get at.
[php]
int main()
{
int x =10;
cout<< x;
cin.get();
if(cin.get() == 2){
// Do whatever I want here.
}
return 0;
}
[/php]
Is this possible? Or what's the other way to do it? I can think of a couple but yeah, this is a question I had.
Thanks gais. Love yew. ♥