Thread: Some basic array or structure program

  1. #16
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    But they are integers. A char is nothing more than a smaller int. For instance 'A' has value 65 decimal, 'B' has the value 66 decimal, and so forth. This is what C "sees". When you use the character constant 'A', C sees 65 (well, it actually sees 01000001 (65 in binary) I guess, but that's beside the point). So you can just do if(input_character >= 'A' && input_character <= 'Y') to see if it's one of those characters.
    Last edited by itsme86; 03-10-2005 at 10:58 AM.
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  2. Strange structure array issue...
    By IndioDoido in forum C Programming
    Replies: 9
    Last Post: 03-23-2008, 06:29 AM
  3. Dynamic structure with array and array count
    By Nazgulled in forum C Programming
    Replies: 14
    Last Post: 06-08-2007, 10:10 PM
  4. Need some help with a C program...
    By pityocamptes in forum C Programming
    Replies: 1
    Last Post: 03-25-2005, 06:43 PM
  5. My Program
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 02-27-2002, 02:41 PM