114k views
2 votes
What is the output of the following code? int *p; int x; x = 12; p = &x; cout << x << ", "; *p = 81; cout << *p << endl;

User Chumie
by
7.8k points

1 Answer

3 votes
Without

#include <iostream>
using namespace std;

It probably won't compile, so no output.

The less pedantic answer:

12,81

on it's own line ( std.endl).
User Lpt
by
8.2k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.