- #1
Nusc
- 760
- 2
void PrintTranscript( const vector <student>& a )
{
cout << "Here is a list of courses that you have taken:" << endl;
for (int i = 0; i<a.size(); i++)
{
line 104: for (int j = 0; j<a.size(); j++)
cout << a.firstname << " " << a.lastname << " " << a.id << endl;
line 106: cout << a.courses[j].session << " " << a.courses[j].year << " " << a.courses[j].coursename << " " << a.courses[j].percentage << " " << a.courses[j].lettergrade << endl;
}
}
PI.cc:106: error: name lookup of `j' changed for new ISO `for' scoping
PI.cc:104: error: using obsolete binding at `j'
Can anyone please help me?
{
cout << "Here is a list of courses that you have taken:" << endl;
for (int i = 0; i<a.size(); i++)
{
line 104: for (int j = 0; j<a.size(); j++)
cout << a.firstname << " " << a.lastname << " " << a.id << endl;
line 106: cout << a.courses[j].session << " " << a.courses[j].year << " " << a.courses[j].coursename << " " << a.courses[j].percentage << " " << a.courses[j].lettergrade << endl;
}
}
PI.cc:106: error: name lookup of `j' changed for new ISO `for' scoping
PI.cc:104: error: using obsolete binding at `j'
Can anyone please help me?