Question
The following requires the knowledge and use of C. Complete the following setName, getStudentID, and setStudentID functions: #define MAX_NAME_LEN 128 typedef struct { char name[MAX_NAME_LEN];
The following requires the knowledge and use of C.
Complete the following setName, getStudentID, and setStudentID functions:
#define MAX_NAME_LEN 128
typedef struct {
char name[MAX_NAME_LEN];
unsigned long sid;
} Student;
/* return the name of student s */
const char* getName(const Student* s) {
return s->name;
}
/* set the name of student s */
void setName(Student* s, const char* name) {
/* fill me in */
}
/* return the SID of student s */
unsigned long getStudentID(const Student* s) {
/* fill me in */
}
/* set the SID of student s */
void setStudentID(Student* s, unsigned long sid) {
/* fill me in */
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started