Thread: detecting characters

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    15

    detecting characters

    I am storing a string in an array of type of char and then break the string length into lowercase, uppercase, digits, other printable characters and whitespace.

    For the "other printable characters" I am using

    Code:
    if (isgraph(str[i]) && (isalnum(str[i]) == false))
    is there any library function which returns just that or shall i stick with the above line?

    Thank You

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    Once you've weeded out the alpha, the numerics and whitespace, then just apply isprint().
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Detecting illegal characters
    By paul_harris77 in forum C Programming
    Replies: 14
    Last Post: 02-28-2009, 02:58 PM
  3. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  4. How do you check how many characters a user has entered?
    By engstudent363 in forum C Programming
    Replies: 5
    Last Post: 04-08-2008, 06:05 AM
  5. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM