The exam will include all the material covered in discussion session (lab), lecture, quizzes, exercises, and projects (#1 and #2, #3, #4) including the following topics:
The exam will NOT cover the following topics:
Instead of
if (ptr != NULL) {
}
use
if (ptr) {
}
When you have nested structures defining a pointer to a field can help.
/* Using a pointer to simplify handling structure fields */
printf("Section number is %d\n", all_courses[1].section1.section_number);
printf("Section number is %d\n", all_courses[1].section1.num_students);
/* Equivalent to previous two statements */
ptr = &all_courses[1].section1;
printf("Section number is %d\n", ptr->section_number);
printf("Number of students %d\n", ptr->num_students);
Instead of
if (strcmp(a, b) == 0) {
}
use
if (!strcmp(a, b)) {
}
Instead of
while (*p != '\0') {
}
use
while (*p) {
}
Node *curr = head;
while (curr) {
/* task here */
curr = curr->next;
}
Node *prev = NULL, *curr = head;
while (curr) {
/* task here */
prev = curr;
curr = curr->next;
}
Practice material can be found in the grace system under 216public/exams/exam2. To transfer this material to your computer use https://dav.terpconnect.umd.edu . Use your directory id/passwd (same one used for grace) to log on.