cleaner comments
This commit is contained in:
1 file changed
+3
-9
@@ -4,11 +4,8 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We define the constants here so the the processor
|
Using define instead of constants prevents
|
||||||
replaces the var name with the actual value to prevent
|
"Variable modified error"
|
||||||
"Variable modified error during compile"
|
|
||||||
- give me a break I am learning and need this note to
|
|
||||||
tell me why I am doing this
|
|
||||||
*/
|
*/
|
||||||
#define MAX_COURSE_DES_LEN 50
|
#define MAX_COURSE_DES_LEN 50
|
||||||
#define MAX_COURSE_NO_LEN 20
|
#define MAX_COURSE_NO_LEN 20
|
||||||
@@ -93,14 +90,12 @@ CSV_LINE *csvReader(char data_dir[]) {
|
|||||||
|
|
||||||
/*** DEFINE STUDENT DATA STRUCTURES & COURSE DATA STRUCTURES***/
|
/*** DEFINE STUDENT DATA STRUCTURES & COURSE DATA STRUCTURES***/
|
||||||
|
|
||||||
// REQUEST
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char crsNo[MAX_COURSE_NO_LEN];
|
char crsNo[MAX_COURSE_NO_LEN];
|
||||||
char description[MAX_COURSE_DES_LEN];
|
char description[MAX_COURSE_DES_LEN];
|
||||||
bool alt;
|
bool alt;
|
||||||
} REQUEST;
|
} REQUEST;
|
||||||
|
|
||||||
// STUDENT
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char pupilNum[MAX_PUPIL_NUM_LEN];
|
char pupilNum[MAX_PUPIL_NUM_LEN];
|
||||||
REQUEST request[TOTAL_BLOCKS + MAX_REQUEST_ALTS];
|
REQUEST request[TOTAL_BLOCKS + MAX_REQUEST_ALTS];
|
||||||
@@ -111,7 +106,6 @@ typedef struct {
|
|||||||
short studentIndex;
|
short studentIndex;
|
||||||
} STUDENT;
|
} STUDENT;
|
||||||
|
|
||||||
// COURSE
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char crsNo[MAX_COURSE_NO_LEN];
|
char crsNo[MAX_COURSE_NO_LEN];
|
||||||
short requests;
|
short requests;
|
||||||
@@ -142,7 +136,7 @@ int main(int argc, char **argv) {
|
|||||||
CSV_LINE *lines = csvReader(data_dir);
|
CSV_LINE *lines = csvReader(data_dir);
|
||||||
if (lines == NULL) return -1;
|
if (lines == NULL) return -1;
|
||||||
|
|
||||||
STUDENT *students = getStudents("../sample_data/course_selection_data.csv", TOTAL_BLOCKS);
|
STUDENT *students = getStudents(lines, TOTAL_BLOCKS);
|
||||||
if (students == NULL) return -1;
|
if (students == NULL) return -1;
|
||||||
|
|
||||||
free(lines);
|
free(lines);
|
||||||
|
|||||||
Reference in new issue
Block a user