Post a New Question

C++ Programming

posted by .

What is the output of the following C++ code?

p = list;

while (p!=NULL)
cout << p->info << " ";
p = p->link;
cout << endl;

  • C++ Programming -

    That's code to walk through a linked list. I can't say the exact output because I can't see what the variable "list" is.

    Also, there are missing braces after the while statement. If the program is run without braces, and list is not null, the iteration will infinitely loop and print the first element over and over.

Answer This Question

First Name
School Subject
Your Answer

Related Questions

More Related Questions

Post a New Question