new-delete & struct & arrays. HELP

hello i have an struct like this:

1
2
3
4
5
6
struct Student
{
 string name,lettergrade;
 int stdnumber,*examgrades;
 double  avarege;
};


I have to make a programme which it calculates student's avarege and letter grades.

I have to use this functions:


1
2
3
4
void getdata();
double calcgrades();
void show();
void erase();


I have to ask user the total number of students and total number of exams. then i have to allocate the necessary memory spaces. (with dynamic allocation)


The output screen must be like this:


Enter the number of students: 2
Enter the number of exams: 2
1. student's name: michael
1. student's school number: 5000
1. student's 1. exam grade: 50
1. student's 2. exam grade: 40
The avarege of this student is: 45
2. student's name: mary
2. student's school number: 6000
2. student's 1. exam grade: 70
2. student's 2. exam grade: 80
The avarege of this student is: 75


Note: bold ones are keyboard input.

My problem is, i cant allocate it for the string variables, like student name and letter grade...

Letter grades are A: 85-100, B:75-84, C:65-74, D:50-64,F:0-49 over 100 points.

Can anyone has any idea about this problem?
Hello,
From what I see, what would need to be allocated are the struct Student and the int pointer examgrades.

Not sure I've understood, your problem in fact.
Topic archived. No new replies allowed.