Skip to main content
Formatting.
Source Link
slugonamission
  • 9.7k
  • 1
  • 36
  • 41

I'm just trying to understand the difference in how you output pointers.

let's say I have:

int x = 100;

int*p = &x;

int x = 100; int*p = &x; 

what would each of the following do?

cout << p << endl; cout << *p << endl; cout << &p << endl;

cout << p << endl; cout << *p << endl; cout << &p << endl; 

I'm just trying to understand the difference in how you output pointers.

let's say I have:

int x = 100;

int*p = &x;

what would each of the following do?

cout << p << endl; cout << *p << endl; cout << &p << endl;

I'm just trying to understand the difference in how you output pointers.

let's say I have:

int x = 100; int*p = &x; 

what would each of the following do?

cout << p << endl; cout << *p << endl; cout << &p << endl; 
Source Link
TRod
  • 293
  • 2
  • 10
  • 20

Pointer outputs

I'm just trying to understand the difference in how you output pointers.

let's say I have:

int x = 100;

int*p = &x;

what would each of the following do?

cout << p << endl; cout << *p << endl; cout << &p << endl;