Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions