isnumeric

This is a discussion on isnumeric within the C++ Programming forums, part of the General Programming Boards category; I'm looking for an isnumeric function. I saw a few diference google references but the best I can make is: ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    128

    isnumeric

    I'm looking for an isnumeric function. I saw a few diference google references but the best I can make is:
    Code:
    			if (!isnumeric(strSSN))
    			{
    				strSSN = "000000000";
    			}
    This gives me "'isnumeric' : undeclared identifier"

    What header shoudl I user? I'm guessing that's the problem.

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    isdigit() will test one character to see if it is a valid digit. You could easily write your own isnumeric() function to test the entire string. Don't forget to allow for '-' and '.' characters in the string.

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