If you want the character representation of a digit, wrap it in single quotes:
if (studentId[3] == '1')
cout << "Freshman ";
else if (studentId[3] == '2')
cout << "Sophmore ";
else if (studentId[3] == '3')
cout << "Junior ";
else if (studentId[3] == '4')
cout << "Senior ";
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004