Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. void call_input(char time_of_call[])
  2. {
  3.     char yes_or_no[4] = "no";
  4.     cin >> time_of_call;
  5.     time_of_call[sizeof(time_of_call) - 1] = '\0';
  6.     while(yes_or_no[0] != 'y' && yes_or_no[1] != 'e' && yes_or_no[2] !='s') {
  7.         cout << "\nYour time was " << time_of_call
  8.              << "\nIs this correct > ";
  9.         cin >> yes_or_no;
  10.         yes_or_no[sizeof(yes_or_no) -1] = '\0';
  11.         if(yes_or_no[0] != 'y' && yes_or_no[1] !='e' && yes_or_no[2] !='s') {
  12.             cout << "Enter the time again > ";
  13.             cin >> time_of_call;
  14.             time_of_call[sizeof(time_of_call) - 1] = '\0';
  15.         }
  16.     }
  17.     return;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement