I made a function that tells me if I only have digits.
I tried doing -- ; however this just messes up my negative numbers.
bool isDigit (const std::string &str) {
return !(str.find_first_of("!@#$^&*()_=+abcdefghifklmnopqrst"
"uvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") == std::string::npos);
}
Aucun commentaire:
Enregistrer un commentaire