Advertisement
Guest User

Untitled

a guest
Sep 26th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool playAgain(void){
  2.   char cRetry[2];
  3.   cRetry[0] = '\0';
  4.  
  5.   while((cRetry[0] != 'y') && (cRetry[0] != 'n')){
  6.     printf("Would you like to try again? [y/n]");
  7.     fgets(cRetry, 2, stdin);   
  8.     if(cRetry[0])
  9.       cRetry[0] = tolower(cRetry[0]);  
  10.   }
  11.    
  12.   return(cRetry[0] == 'y');
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement