keyboard input

This is a discussion on keyboard input within the C Programming forums, part of the General Programming Boards category; I am trying to write a program to determin if a character entered bykeyboard is a uuper case, lower case, ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    7

    keyboard input

    I am trying to write a program to determin if a character entered bykeyboard is a uuper case, lower case, digit or symbol. Someone please point in the wirte direction. Thanx

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Characters all have numerical value which are arranged sequentially, so eg, you can test for a lower case letter with
    Code:
    if (ch >= '0' && ch <= '9') ...
    For more info see the ASCII table:
    ASCII Table / Extended ASCII Codes
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,424
    islower(), isupper(), isdigit(), etc functions are portable
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help using inline assembly for keyboard input
    By sleventeen in forum C Programming
    Replies: 7
    Last Post: 05-10-2009, 01:31 AM
  2. Keyboard Input
    By CaliJoe in forum C++ Programming
    Replies: 3
    Last Post: 05-08-2009, 09:51 AM
  3. Keyboard input in a Dialog
    By ksarkar in forum C++ Programming
    Replies: 1
    Last Post: 05-20-2005, 05:39 AM
  4. Intercepting keyboard input
    By EvBladeRunnervE in forum Windows Programming
    Replies: 3
    Last Post: 01-08-2004, 08:03 AM
  5. FAQ Keyboard Input ? (C++)
    By Malikive in forum FAQ Board
    Replies: 6
    Last Post: 11-07-2001, 08:30 PM

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