Case Sensitive

This is a discussion on Case Sensitive within the C++ Programming forums, part of the General Programming Boards category; How do I make a program that reads an input thats not case sensitive? I'm making a password program that ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    44

    Case Sensitive

    How do I make a program that reads an input thats not case sensitive?

    I'm making a password program that I want not to be case sensitive. Can any one shed some light?
    I'm using Bloodsheds Dev-C++ Compiler.

    JamMan..

    Curious if I can live forever? CLICK HERE

  2. #2
    Registered User *pointer's Avatar
    Join Date
    Oct 2001
    Posts
    74
    That's an easy one, read the input however the user types it in and then parse the string to be all upper or lower case.
    Code:
    int main(void){
        char pWord[SIZE];
        
        pWord = cin.getline();
        for(int i = 0; i < SIZE; i++){
            toupper(pWord[i]);
        }
       
        return 0;
    }
    Be sure to include ctype.h in your program or toupper() and tolower() won't work.
    pointer = NULL

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Format Precision & Scale
    By mattnewtoc in forum C Programming
    Replies: 1
    Last Post: 09-16-2008, 10:34 AM
  2. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 04:42 PM
  3. Intel syntax on MinGW ?
    By TmX in forum Tech Board
    Replies: 2
    Last Post: 01-06-2007, 08:44 AM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. returning to a spot in the code
    By Shadow in forum C Programming
    Replies: 4
    Last Post: 09-22-2001, 05:24 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21