Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. What does the following C-statement declare?
    int (*f) int*);
    1. A function that takes an integer pointer as argument and returns an integer
    2. A function that takes as argument and returns an integer pointer
    3. A pointer to a function that takes an integer pointer as argument and returns an integer
    4. A function that takes an integer pointer as argument and returns a function pointer
Correct Option: C

Syntax to declare pointer to a function => datatype (*pointer_variable)(list of arguments)
To make a pointer to a function => pointer_variable = function_name
Note : don't use parenthesis of the function.
To call (invoke) the function => pointer_variable (list of arguments)



Your comments will be displayed only after manual approval.