C++ Array practicing help.

Hello all. I just started Arrays in my course and im doing some self practice but I've run into a bump. I'm using this array to output the grade for individual students when their name is entered. (Short code incoming)
Any advice/help is appreciated

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #include <iostream>
#include <string>
using namespace std;

int main()
{
   int grades[6] = {50, 60, 70, 80, 90, 100};
   string studentname;

   cout <<"Enter student name" << endl;
   cin >> studentname;

   if(studentname==justin)
   cout <<"Justins grade is: " << grades[0] << endl;


    return 0;
}


"error: ' justin was not declared in this scope
if(studentname==justin)

Should be :
if(studentname == "justin")
TY.
Topic archived. No new replies allowed.