Thread: characters

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    79

    characters

    Hello,

    How could I make that a scanf input is always a character? and return an error if a number is put in.

    Thanks

  2. #2
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    Can you elaborate more?
    Do you want to input characters and don't want digits in it?
    Or just one char which is not digit?

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    As Bayint Naung said, you'll need to elaborate more so we have a better idea of what you're trying to do. It may help you, however, to know that in ctype.h there are several functions that will easily tell you if a function is a digit, a letter, or part of any other significant group of possible inputs.

    The C Standard Library

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. Replies: 2
    Last Post: 09-16-2009, 06:00 AM
  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