In the simplest sense you prompt a user with a cout<< or printf() statement and then provide the user with a scanf() or cin>> statement which will take her input.
You can use an if statement or try, throw and catch statements to control what will be accepted as input.e.g.:
Code:
cout<<"state your age";cin>>age;if(age<5||age >105)
cout<<"are you sure";
You can't actually limit what the user types into stdin (the console) all you can do is read what is input and if it is not correct display and error and request the input again.
Comment