Multiple choice

Which of the following is the correct way of declaring a float pointer?

  1. float ptr

  2. float *ptr

  3. *float ptr

  4. none of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In C, a pointer variable is declared by placing an asterisk before the variable name, such as float *ptr.