Code:bool check_string_numeric(std::string str) { for(int i = 0; i < str.length(); i++) { if(!( (str.c_str()[i] >= '0') && (str.c_str()[i] <= '9') ) ) { //Not numeric return false; } } //numeric return true; }
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 13 of 13
Thread: std::string all numericThreaded View
|
Click Here to Expand Forum to Full Width |