A

Admin • 833K Points
Coach

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: 29
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

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.