Getting this error from my code. I had looked at similar questions on here but wasn't able to see why mine wasn't working (most answers involved chars and people using " instead of ', which wasn't really helpful to me). Not sure what I'm missing here. Edit: To be a little more specific it's the ">" sign in my if statement that is giving me trouble. My code is below:
int main()
{
int numGrades = 0;
double *scores = nullptr;
double total = 0;
cout << fixed << setprecision(1);
cout << "How many grades would you like to enter? ";
cin >> numGrades;
if (numGrades < 0)
{
cout << "Error, please enter positive values only: ";
cin >> numGrades;
}
scores = new double[numGrades];
for (int x = 0; x <= numGrades; x++)
{
cout << "Please enter student " << (x + 1) << "'s score: ";
cin >> scores[numGrades];
if (scores < 0 && scores > 100) //ERROR IS HERE
{
cout << "Please enter a value between 0 and 100: ";
cin >> scores[numGrades];
}
}