Thread: converting chars to uppercase/lowercase

  1. #1
    Unregistered
    Guest

    converting chars to uppercase/lowercase

    Argh!! I know there's a function for doing this but I can't remember what it is! Does anybody know it?

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    toupper() to convert to upper case.
    tolower() to convert to lower case.

  3. #3
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    toupper(). (which is included in ctype.h)
    lowercase is tolower()

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Or write your own. Write an array for a string, or if it's single don't. Then find the difference in ascii value for a and A, then convert to unsigned int, add to the other number, convert back to char. vice versa for the lowercase.

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Also for future reference, there's list of all the common functions on this site. All the names are pretty descriptive - that should help a lot.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. joining two chars together and converting to INT
    By tehprince in forum C++ Programming
    Replies: 5
    Last Post: 12-21-2007, 02:08 PM
  2. converting ints to chars
    By e66n06 in forum C Programming
    Replies: 4
    Last Post: 07-28-2007, 03:52 PM
  3. Converting strings to chars
    By Suchy in forum C++ Programming
    Replies: 4
    Last Post: 05-06-2007, 04:17 AM
  4. atoi not converting chars to ints?
    By C++Child in forum C++ Programming
    Replies: 13
    Last Post: 10-08-2004, 03:59 PM
  5. converting chars to ascii equivilant
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 09-01-2001, 12:03 PM