Maybe I am overanalyzing this

This is a discussion on Maybe I am overanalyzing this within the C++ Programming forums, part of the General Programming Boards category; I understand I can use the function isdigit() to check if a char has the value 0-9, but what about ...

  1. #1
    Unregistered
    Guest

    Unhappy Maybe I am overanalyzing this

    I understand I can use the function isdigit() to check if a char has the value 0-9, but what about floats? I have a float that I would like to verify contains only digits and the ".". Is there some function that will do this?

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    139
    I don't think so (could be wrong though) but you can make your own easily.
    "The most common form of insanity is a combination of disordered passions and disordered intellect with gradations and variations almost infinite."

  3. #3
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317
    ispunct will check for punctuation characters
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

  4. #4
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

Popular pages Recent additions subscribe to a feed

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