P

Priyanka Tomar • 35.28K Points
Coach

Q. Which of the following is the correct way to define a constant pointer in C++?

  • (A) int* const ptr;
  • (B) const int* ptr;
  • (C) int const* ptr;
  • (D) const ptr* int;
  • Correct Answer - Option(A)
  • Views: 55
  • Filed under category C++

Explanation by: Priyanka Tomar
In C++, 'int* const ptr;' defines a constant pointer to an integer.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics