digit, char, etc..

This is a discussion on digit, char, etc.. within the C Programming forums, part of the General Programming Boards category; I am trying to change characters in a string. I have managed to do that. But I want to keep ...

  1. #1
    Unregistered
    Guest

    digit, char, etc..

    I am trying to change characters in a string. I have managed to do that. But I want to keep spaces, numbers and puntuations unchanged . How can i do that?

  2. #2
    Visionary Philosopher Sayeh's Avatar
    Join Date
    Aug 2002
    Posts
    212
    Well, when you examine each character, a good place to start is with an 'if()' statement. IF it's something you don't want to change, skip to the next character.
    It is not the spoon that bends, it is you who bends around the spoon.

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    In ctype.h: isalpha(), isdigit(), isalnum() etc Use these to test a single character.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting Linked Lists
    By DKING89 in forum C Programming
    Replies: 6
    Last Post: 04-09-2008, 08:36 AM
  2. Conversion Char To Char * Problem
    By ltanusaputra in forum Windows Programming
    Replies: 3
    Last Post: 03-01-2008, 02:06 PM
  3. newbie needs help with code
    By compudude86 in forum C Programming
    Replies: 6
    Last Post: 07-23-2006, 09:54 PM
  4. Need help understanding info in a header file
    By hicpics in forum C Programming
    Replies: 8
    Last Post: 12-02-2005, 12:36 PM
  5. How do i un-SHA1 hash something..
    By willc0de4food in forum C Programming
    Replies: 4
    Last Post: 09-14-2005, 06:59 AM

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