I think a two dimensional array would be a good move. You do not know ahead of time, I imagine, the number of different exams. So you will not know the dimensions of the array ahead of time. So you'll have to dynamically declare a 2-dimensional array. Before doing so you will need to be able to go through the big vector of type student and count the number of unique exam codes, as well as extract those unique exam codes. Your 2-dimensional array's dimensions will be determined by that count.

I assume you mean "access", not "call". There is no "exam id" in your struct. There is "studentid" and "examcode".

You need to be more careful and detailed when writing your posts, and you need to preview your posts before you submit them. I put "code=C++" in quotes because when I put them in brackets, the web page didn't recognize that I wanted to display the actual words. I see you just posted with the C++ code tags so that's good, but you need to indent so people can follow the logic. That's the whole point of the code tags. The code tags are pointless when the spacing is so strange.

Reread my previous post. Doing what you want to do is going to require much more than the few lines that you've posted. Describe what you have done, what you know how to do, what you don't, what's worked, what's failed, etc., and ask a specific question. This will take more than a few lines of code and more than one sentence to describe.

You need to be more careful and detailed when writing your posts, and you need to preview your posts before you submit them. I put "code=C++" in quotes because when I put them in brackets, the web page didn't recognize that I wanted to display the actual words. I see you just posted with the C++ code tags so that's good, but you need to indent so people can follow the logic. That's the whole point of the code tags. The code tags are pointless when the spacing is so strange.

In other wordsRead the Rules -- as you were asked when you registered.Read This because it's title says you should
and Read This to understand proper formatting.

Yes, there's some reading involved, but you want us to be able to help you -- right? The more we can understand, the better the help.

oic..examid is examcode..so i wrong..to access the exam id in increasing order how?

Did you read any of WaltP's links? Did you read my post? You AGAIN ask how to access a non-existent variable called "exam id", when earlier in the sentence you show that you realize that it does not exist. After the links were posted explaining how to indent code for higher readability, you again post code like this:

One is easily readable, one is not. If you go over posts from your earlier threads, there is an awful lot of posts where the problem is that you put code in the wrong place and neither you nor people trying to help were able to spot it. I think that is in large part because the spacing you use makes it extremely hard to spot stuff like missing brackets. Please read the three links that WaltP posted and follow their guidelines. You are far more likely to get good help if you do.