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
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
Why do we write return 0 in c?
What is n in c?
Explain what is the difference between functions getch() and getche()?
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
What is structure pointer in c?
What are the benefits of organizational structure?
How many parameters should a function have?
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
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What is else if ladder?
Write a program to know whether the input number is an armstrong number.
How can I automatically locate a programs configuration files in the same directory as the executable?
When is a void pointer used?
What are the 5 types of inheritance in c ++?