What is the correct interpretation of the following declaration in C++? int…

2018

What is the correct interpretation of the following declaration in C++?
int (*FPTR)(char*)

Answer: C. FPTR is a pointer to a function, which takes character pointer as an argument and returns integer valueThe declaration int (* FPTR)(char* ) defines a pointer named FPTR to a function. This function accepts a character pointer argument and returns an integer…

  1. A.

    FPTR is a pointer to character

  2. B.

    FPTR is a pointer to a function, which takes character as an argument and returns integer value

  3. C.

    FPTR is a pointer to a function, which takes character pointer as an argument and returns integer value

  4. D.

    FPTR is a function, which takes character pointer as an argument and returns integer pointer

Attempted by 269 students.

Show answer & explanation

Correct answer: C

The declaration int (* FPTR)(char* ) defines a pointer named FPTR to a function. This function accepts a character pointer argument and returns an integer value.

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…