Defining enter etc..

How do you define ENTER and BACKSPACE to use in a code like:
1
2
3
4
5
6
7
8
9
10
11
12
  
        cout<<"Press BACKSPACE to exit...\n";
	cout<<"Press ENTER to continue...\n";
	cin>>exit;
	if (exit == '\b')
		return 0;
	else if (exit == '\r')
		goto previous;
	else
		cout<<"Invalid Entry\n";
		goto next;
}

Please tell me how to define it instead of using \r or \b which doesn't work =(
You cannot use std::cin to get keystrokes. It is a buffered input stream that reads in formatted data.

The answer to that question is really OS-specific. So... what OS is this for?
I use Windows Vista (Win32).
Okay, it might help a lot if I understood the codes you wrote there.
Anyway, can you explain some of this:
1
2
3
4
5
6
7
8
#include <iostream>
#include <limits>

void PressEnterToContinue()
  {
  std::cout << "Press ENTER to continue... " << flush;
  std::cin.ignore( std::numeric_limits <std::streamsize> ::max(), '\n' );
  }

What does the "flush" mean/do?
And what does the line cin.ignore( std::numeric_limits <std::streamsize> :: max() mean?
(As you see I'm rly nub in programming, forgive me =] )
Topic archived. No new replies allowed.