A

Admin • 833K Points
Coach

Q. Which of the following is the correct syntax for defining a pointer to an integer in C++?

  • (A) int ptr;
  • (B) int *ptr;
  • (C) int &ptr;
  • (D) pointer<int> ptr;
  • Correct Answer - Option(B)
  • Views: 18
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

In C++, an asterisk (*) is used to define a pointer to an integer, like 'int *ptr;'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.