Hi all .. i need urgent help please
i made the following struct
Code:
struct student
{
char name[10]; // for the name of the student
int BN;// for the bench number
int year ,section,exam;
double mark;
}; //for the mark of the student
in the main function i tried to make the following
Code:
int i;
cout<<"enter i ";
cin>>i;
student *p =new student[i];
int j=0;
cout<<"enter the name:";
cin>>p[j].name;
but it fails
what is the problem with the pointer of the array of students
it gives error
so anyone can help me please
thanks in advance