KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I compiled this code at home on my mac w/ xcode and there was no provblem. I compile it at school with g++ on linux and I get these errors: numeric_limits’ is not a member of std expected primary-expression before ‘>’ token no matching function for call to ‘max()’ #include <iostream> #include <cstdlib> using namespace std; int GetIntegerInput(int lower, int upper) { int integer = -1; do { cin >> integer; cin.clear(); cin.ignore(std::numeric_limits<streamsize>::max(), '\n'); //errors here } while (integer < lower || integer > upper); return integer; } I'm guessing maybe I have to include an extra header. If I take away the std:: it just gives me a similar error: numeric_limits was not declared in this scope
Tags (comma-separated)
Save Edits
Cancel