-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStructures.h
More file actions
66 lines (56 loc) · 1.09 KB
/
Copy pathStructures.h
File metadata and controls
66 lines (56 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Libraries
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Data constants
#define STUDENT_MAX 100
#define COURSES_MAX 25
#define STUDENT_MAX_COURSES 4
#define GRADES_MAX 10
#define COURSES_MAX_STUDENTS 20
#define MAX_STUDENT_NAME 20
#define MAX_COURSE_SUBJECT 4
#define MAX_COURSE_NAME 20
#define STUDENT_ID 10000001
#define BUFFER 2
typedef struct
{
int ID;
char fname[MAX_STUDENT_NAME]; // First and Last name of the student
char lname[MAX_STUDENT_NAME];
int amountOfCourses;
struct stu *next;
}student;
typedef struct
{
char department[MAX_COURSE_SUBJECT];
int ID;
char idName[MAX_COURSE_NAME];
int studentsEnrolled;
struct course *next;
}course;
typedef struct
{
int studentID;
int courseID;
int gradeCount;
int gradeCap;
int *gradeList;
struct enroll *next;
}enrollment;
// Dynamic memory allocation setup
typedef struct{
int studentCount;
int *studentCap;
student *studentList;
}students;
typedef struct{
int courseCount;
int *courseCap;
course *courseList;
}courses;
typedef struct{
int enrollCount;
int *enrollCap;
enrollment *enrollList;
}enrollments;