daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //recursive function that asks for user to enter a given range of input
  2. //returns either y or n
  3. string user_input ()
  4. {
  5.     cout << "Enter either y or n";
  6.     string input;
  7.     cin >> input;
  8.  
  9.     if (input == "y" || input == "n")
  10.     {
  11.         return input;
  12.     }
  13.     else
  14.         return user_input();
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top