struct student {
char *s_name;
struct student_id s_id;
/** Number of references to this student. */
unsigned int s_ref;
/** Transcript (singly-linked list, NULL terminator). */
struct transcript_entry *s_transcript;
/** Whether or not this student has completed his/her program. */
student_complete s_complete;
};
struct student* student_grad_create(const char *name, size_t namelen,
struct student_id, int phd);
struct student* student_undergrad_create(const char *name, size_t namelen,
struct student_id);
Есть три вида студента, магистранта и аспирант и старшекурсник студента .I необходимо реализовать функцию, которая называется:же функция, но другой мимолетный аргумент функции
int student_add_entry(struct student *, struct transcript_entry *);
Я не знаете, как я могу определить тип студента?
Должен ли я сделать следующее?
int student_add_entry(struct student *undergrad_create, struct transcript_entry *){}
int student_add_entry(struct student *grad_create, struct transcript_entry *){}
спасибо.
Это очень смешная идея ... Что бы вы достигли с этим? –
Вы уверены, что хотите 'C'? В любом случае, как насчет «перечисления», указывающего тип студента? –
C не имеет функции перегрузки. –