Strings and Structures/assign4.c
void addCourseInfo(CourseInfo *courses, int *courseCount, char *record){
    int validateData(const CourseInfo *courses, const size_t courseCount, CourseInfo courseInfo);

    int index = *courseCount;
    CourseInfo newCourseInfo = {0};
    processCourseRecord(record, &newCourseInfo);
    newCourseInfo.courseID = (*courseCount) + 1;
    
    
    if(validateData(courses, *courseCount, newCourseInfo) == NOT_FOUND){
        courses[index] = newCourseInfo;

        (*courseCount)++;
    }
    else printf("%s %s\n","*DUPLICATE COURSE ID OR CODE* UNABLE TO ADD:", newCourseInfo.courseName);
}
/*
    addCourseInfo: adds a new course to the courses array
    input: the array to be added to, the number of courses existing (courseCount), the course data to be added (record)
*/
adds a new course to the courses array
input: the array to be added to, the number of courses existing (courseCount), the course data to be added (record)
adds a new course to the courses array input : the array to be added to the number of courses existing ( courseCount ) the course data to be added ( record )
void addCourseInfo(CourseInfo *courses, int *courseCount, char *record){
    int validateData(const CourseInfo *courses, const size_t courseCount, CourseInfo courseInfo);
    int index = *courseCount;
    CourseInfo newCourseInfo = {0};
    processCourseRecord(record, &newCourseInfo);
    newCourseInfo.courseID = (*courseCount) + 1;
    if(validateData(courses, *courseCount, newCourseInfo) == NOT_FOUND){
        courses[index] = newCourseInfo;
        (*courseCount)++;
    }
    else printf("%s %s\n","*DUPLICATE COURSE ID OR CODE* UNABLE TO ADD:", newCourseInfo.courseName);
}
void addCourseInfo ( CourseInfo * courses , int * courseCount , char * record ) { int validateData ( const CourseInfo * courses , const size_t courseCount , CourseInfo courseInfo ) ; int index = * courseCount ; CourseInfo newCourseInfo = { 0 } ; processCourseRecord ( record , & newCourseInfo ) ; newCourseInfo . courseID = ( * courseCount ) + 1 ; if ( validateData ( courses , * courseCount , newCourseInfo ) == NOT_FOUND ) { courses [ index ] = newCourseInfo ; ( * courseCount ) ++ ; } else printf ( " \n " , " " , newCourseInfo . courseName ) ; }
addCourseInfo: adds a new course to the courses array
input: the array to be added to, the number of courses existing (courseCount), the course data to be added (record)
addCourseInfo : adds a new course to the courses array input : the array to be added to the number of courses existing ( courseCount ) the course data to be added ( record )