I have not got ur question completely ,
1. Passing a struct by ref :
if u have a struct say:
struct subjectsMarks
{
int Sub1;
int Sub2;
};
void func(subjectsMarks* obj)
{
}
main()
{
subjectsMarks* p = new subjectsMarks;
p->sub1 = 100;
p->sub2 = 200;
func(subjectsMarks);
}
I have not compiled it, but just this might give a rough idea about passing it as a ref.
2. Even if you will use a array, u need to loop & get the average.
Give some snapshot so that we can have a rough idea.