Explain following declaration
int *P(void);
and
int (*p)(char *a);

Answer Posted / binod adhikari

int *p(void)
Here p is a pointer function with no arguments. int *p means p is a pointer function which has to return an memory address of integer type to the called function (i.e. where the pointer function p has been called). (void) means function p does not have any argument.

int *p(char *a);
Here p is a pointer function with one pointer arguments of character type. The called function (i.e. where the pointer function p has been called) pass the memory address of the character variable to pointer function p since it has char *a argument. p is a pointer function so, it has to return an memory address of integer type to the called function.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1453


Why do we write return 0 in c?

542


What is n in c?

569


Explain what is the difference between functions getch() and getche()?

601


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

757






What is structure pointer in c?

565


What are the benefits of organizational structure?

564


How many parameters should a function have?

659


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

672


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

627


What is else if ladder?

603


Write a program to know whether the input number is an armstrong number.

660


How can I automatically locate a programs configuration files in the same directory as the executable?

622


When is a void pointer used?

672


What are the 5 types of inheritance in c ++?

574