Thread: Help with C Programming

  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    1

    Help with C Programming

    Alright so I'm trying to create a program to take input from the user, character by character and then remove certain characters with the ascii codes from 0 through 7, 14 through 31, and 127.

    How would I go about doing this?

    I know that I should use the getchar function to accept the input from the user, but how do I check the inputted character to see if they were one of the ones I'm supposed to remove?

  2. #2
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    The characters are stored as their ASCII values.

    Ascii Table - ASCII character codes and html, octal, hex and decimal chart conversion

    What you can do is use an if statement to see if the input is in the ranges you want: Use '<', '>'

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 12-11-2011, 04:25 PM
  2. Replies: 1
    Last Post: 08-19-2007, 03:55 AM
  3. small programming job VCPP / Object Oriented Programming
    By calgonite in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 01-04-2006, 11:48 PM
  4. Total newb to programming here... Question about the many programming languages. Ty!
    By tsubotakid1 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 10-05-2003, 10:32 AM