A

Admin • 833.24K 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(A)
  • Views: 33
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

The pointer 'ptr' points to x, and *ptr dereferences it to give the value of x, which is 10.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.