#include <iostream.h>
#include <limits>
using namespace std;
int main()
{
int iNum;
cout << "Please enter a Number \n";
cin >> iNum;
cin.ignore(numeric_limitations<int>::max(), '\n');
if (!cin || cin.gcount() != 1)
{
cout << "Not a numeric value.";
}
else if (iNum == 5)
{
cout << "Number is equal to 5";
}
else if (iNum > 5)
{
cout << "Number is greater than 5";
}
else if (iNum < 5)
{
cout << "Number is less than 5";
}
return 0;
}
The 3 errors are:
5.cpp(16) : error C2065: 'numeric_limitations' : undeclared identifier
5.cpp(16) : error C2062: type 'int' unexpected
5.cpp(16) : error C2039: 'max' : is not a member of '`global namespace'
I haven't copied and pasted the three comments and a single line space at the start of the code.
This post has been edited by Reehad: 09 January 2007 - 03:56 AM

New Topic/Question
Reply




MultiQuote





|