Question: The following structs are used in assignment 1: struct a1_course { const char* name; double average; int maxEnrollment; }; struct a1_student { const char* name;

The following structs are used in assignment 1:

struct a1_course

{

const char* name;

double average;

int maxEnrollment;

};

struct a1_student

{

const char* name;

unsigned int id;

a1_course* p_course;

};

struct a1_registrar

{

a1_course* a_courses;

unsigned int numCourses;

a1_student* a_students;

unsigned int numStudents;

};

Question 5 (10 points)

Define a function findStudent that takes an a1_registrar and an const char* student name and returns a pointer to the first a1_student struct that contains that name or NULL if no match is found. Recall that function strcmp compares two c-strings and return 0 if they match.

Here is the function declaration:

a1_student* findStudent(a1_registrar reg, const char* studentName);

You can write your answer in the space provided or upload a file with your response.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!