Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Case sensitive

  1. #1
    New to the CF scene
    Join Date
    Dec 2002
    Location
    Canada/Québec
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Case sensitive

    if you want YeS to be accepted use this line of code

    #include <ctype.h>
    .
    .
    .
    cin >> correct;
    correct=toupper(correct)
    if (correct == "YES"){

    the toupper will change all the character of correct to capital letter so yes, Yes, YeS, YES are all going to be YES

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Thanks I think you was meant to hit reply instead of new topic


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •