Hello.
I am writing a student records program for class. We are supposed to make two structures, one for students and one for courses. Inside each structure the needs to be an array of pointers to the other structure. I have the structures set up so:
The trouble I am having is inputting the information. I have been trying something likeCode:#include <stdlib.h> #include <stdio.h> #include <string.h> #define MAX_STUDENT_NAME 20 //maximum characters for first or last name #define MAX_CLASS_NAME 30 //maximum characters for class name typedef struct student{ //student info int ID; char fname[MAX_STUDENT_NAME]; char lname[MAX_STUDENT_NAME]; struct course *myClasses[3]; int numClasses; int grades; }student_t; typedef struct course{ // class info char Title[MAX_CLASS_NAME]; char courseID [5]; student_t *myStudents[10]; int grades; int credits; }course_t;
but I get different errors with each variation. Any help would be appreciated.Code:strcpy(course_t.myStudents[0].fname, "Bob");
but I am getting



LinkBack URL
About LinkBacks


