forget exam1 and exam2. What you have in that structure is an array of exam grades. If you want the list of grades you posted in your post #28
stu.examcode.push_back(3);
stu.examcode.push_back(13);
stu.examcode.push_back(34);
... // etc etc for the complete list.
Now if you want to check if exam1 and exam2 are in the list above
for(int i = 0; i < stu.examcode.size(); i++)
{
if( stu.examcode[i] == exam1 || stu.examcode[i] == exam2)
{
// found it so now do something
}
}