V

Vinay • 28.75K Points
Instructor II

Q. What is the output of the following code snippet? int x = 10; int *ptr = &x; cout << ptr;

  • (A) 10
  • (B) Address of x
  • (C) 0
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 40
  • Filed under category C++

Explanation by: Vinay
The pointer 'ptr' holds the address of x, so 'cout << ptr' prints the address of x.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics