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

p = list;

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

The provided C++ code outputs the values of the linked list.

Let's break down the code to understand how it works:

1. `p = list;`: This line assigns the starting node of the linked list to a variable `p`.

2. `while (p != NULL)`: This line creates a loop that iterates until `p` becomes `NULL`. This loop is used to traverse the linked list.

3. `cout << p->info << " ";`: This line prints the `info` value of the node pointed by `p`. The `->` operator is used to access the `info` member of the node. After printing the value, a space is printed using the `<<` operator.

4. `p = p->link;`: This line updates the `p` variable to point to the next node in the linked list. The `link` member of the node represents the link to the next node.

5. `cout << endl;`: This line moves to the next line after printing all the values of the linked list.

To get the output of this code, you need to have a linked list defined and initialized with nodes. The linked list should have at least one node and the `link` member of the last node should be set to `NULL`. By running this code with a linked list, it will print the `info` values of each node in the linked list, separated by spaces, followed by a newline.

Keep in mind that the provided code has a missing pair of braces `{}` to wrap the while loop. Without the braces, only the first statement, `cout << p->info << " ";`, is considered the body of the loop, and the next statement, `p = p->link;`, will run after the loop ends, regardless of the loop condition.

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.