I have this C++ code, which was compiling normally on VsCode C++ extension. Now I try to run same on CodeBlocks, but i get following error:
C:\Users\Downloads\task.cpp|11|error: 'numeric_limits' was not declared in this scope|
C:\Users\Downloads\task.cpp|11|error: expected primary-expression before '>' token|
C:\Users\Downloads\task.cpp|11|error: no matching function for call to 'max()'|
Can somebody enlighten me, what could be done next with this?
The code is as follows:
#include <iostream>
using namespace std;
int read_number(){
int x;
while (true){
cin >> x;
if (!cin){
cout << "Please enter a round number.\n";
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
continue;
}
else break;
}
return x;
}