It means you're assigning a value through a pointer that points to nothing ie -- a NULL pointer. :)

Unit

04-26-2004, 07:35 PM

You defined student.name as a pointer

struct student {
char *name;
float grade;
};
and you are trying to read a string into it without allocating memory!

for(int i=0; i<n; i++) {
cout <<"\nEnter student's name: ";
cin >> s[i].name;
You have allocated memory to the student structure itself. not the name member of it. The result of this would vary a lot from crash right at the start to perfect function of it if you get lucky.