Programming in C - Pointers

21. Consider the declarations
char first (int (*) (char, float)) ;
int second(char, float);
Which of the following function invocation is valid

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


22. A function q that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as

  • Option : A
  • Explanation : Function Input : 'Pointer to a character'.
    For example : Pointer to a character will be represented as "char * Y" which will signify (Y is a pointer to character)
    Similarly in this case, a general argument notation would be "char *"
    Function Output : 'Pointer to an array of integers'.
    For example : Pointer to an array of integers will be represented as "int(*Z)[10]" which will signify (Z is a pointer to an array of integers)
    Similarly in this case, a general argument notation would be "int(*)[]"
    Function Name : 'q'.
    Now, in this case when we combine the input, output and function name, the function representation will becomes int (*q (char*) )[ ]
    This will hence signify that the function takes an input as pointer to a character and returns pointer to an integer array.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


23. Let x be an array. Which of the following operations are illegal?

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


24. If func is a function needing three arguments a1, a2, a3 then func can be invoked by

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


25. The declaration
int (*p) [5];
means

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *