Hey guys
I have written this really simple program and when I compile using VC++ 8.0 express I get 2 errors I cannot fix as they apply to a header file within the compiler's own directory.
Here is the source I have written:
Code:
#include <iostream>
// function prototype
int qualityPoints ( int );
// main function - driver
//
int main ( void ) {
int value = 0;
std::cout << "Enter value to pass range of 1 to 100 ( enter -1 "
<< "to quit ): ";
std::cin >> value;
while ( value != -1 ) {
if (( value < 1 ) || ( value >= 101 )) {
std::cout << "\nIgnoring value - out of range!\n\n";
}
std::cout << "Value returned was: " << qualityPoints( value )
<< std::endl;
}
std::cin.get();
std::cin.ignore();
return 0;
}
// function to return a value pending on the value passed
int qualityPoints ( int x ) {
int point = 0;
if (( x >= 90 ) && ( x <= 100 )) {
point = 4;
}
else if (( x >= 80 ) && ( x <= 89 )) {
point = 3;
}
else if (( x >= 70 ) && ( x <= 79 )) {
point = 2;
}
else if (( x >= 60 ) && ( x <= 69 )) {
point = 1;
}
else {
point = 0;
}
return point;
}
Here are the errors:
Code:
error C2144: syntax error : '__w64 unsigned int' should be preceded by ';'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
The header file it opens is "sourceannations.h" when I click the error message to see which line it is refering too. How can I fix this error? I thought at first the IDE had crashed so I dumped the poject and re-did it, but no same errors again. Then I re-compiled an older program and it worked ok.
im lost here. I appriciate any advice.