Solved

The Following Function Cycles Through a Linked List and Displays

Question 18

Multiple Choice

The following function cycles through a linked list and displays its contents. Line 3 can be replaced with ____.
1 void display(struct myStruct *contents)
2 {
3 while (contents != NULL)
4 {
5 printf("%-30s\n",contents->name, contents->phoneNum) ;
6 contents = contents->nextaddr;
7 }
8 }


A) while (isValid(contents) )
B) while (contents != EOF)
C) while (!contents)
D) while (contents != NIL)

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions