Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. int read_boolean(const char* prompt)
  2. {
  3. my_string line;
  4. int result;
  5.  
  6. line = read_string(prompt);
  7.  
  8. while not (line == "yes" || line == "no" )
  9. {
  10. printf("PLease enter either yes or no")
  11. line = read_string(prompt);
  12. }
  13. if (line = "yes")
  14. {
  15. result = true;
  16. }
  17. else
  18. {
  19. result = false;
  20. }
  21. return result;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement