I need to create a struct which contains 1 int, 2 char, 1 float and (I write the lines from the exercise): "two pointers on functions for reading data void (read*)(student*st)
and one pointer for displaying data void (write*)(student*st)
"
I just don't understand the sentence. I know the syntax for a pointer to function in C. I don't get what read*
and write*
are. If it was *read
and *write
then in would be the pointer variable name to a function and (student*st)
is the parameter, a pointer to struct.
Also, in the exercise appear that the program is about ANSI C but also it asks me to use cin to read the number of students and to allocate memory using new for an array of students.
This is how I started.
struct student {
int idNumber;
char name[100];
char gender[20];
float mark;
??
};