logout

how to allow a user to logout of the program anytime he wants by pressing a dedicated letter or num??
i want the user to logout anytime during the program.
Log out of what?
This is a simple way that doesn't wait for user input...
1
2
3
4
5
6
7
8
int main()
{
while((kbhit() && getch() != 'a')  //only breaks when user presses 'a'
{
   //main code here
}
return 0;
}
Last edited on
okay ...thank you
Topic archived. No new replies allowed.