problem with program

hi, i have a problem with this program, the program doesn't execute the line (cin.get )
plz help







#include<iostream>
#include<string>
using namespace std;
float sum;
struct stud
{
char name[100];
int grades;

};

int main()
{
int size;
stud *ptr;
cin>>size;
ptr= new stud[size];
for(int i=0;i<size;i++)
{
cin.getline(ptr[i].name, 99);
cin>>ptr[i].grades;
}
float sum=0;
for (int i=0;i<size;i++)
{
sum=sum+ptr[i].grades;
}
float c=(sum/size);
for (int i=0;i<size;i++)
{
if (ptr[i].grades>c)
{

cout<<ptr[i].name<<


cout<<endl;

}

}
cout<<endl;
}



Topic archived. No new replies allowed.