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 ? | 9 Yes | 1 No |
Post New Answer View All Answers
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
what is the structure pointer?
What is the difference between near, far and huge pointers?
Explain what are multidimensional arrays?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
Write a C program in Fibonacci series.
How is a null pointer different from a dangling pointer?
Is there any demerits of using pointer?
Explain what’s a signal? Explain what do I use signals for?
Explain the priority queues?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
What are the back slash character constants or escape sequence charactersavailable in c?
What are the characteristics of arrays in c?
Which is the best website to learn c programming?