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
explain how do you use macro?
Are the expressions * ptr ++ and ++ * ptr same?
What is this infamous null pointer, anyway?
What are qualifiers in c?
What are high level languages like C and FORTRAN also known as?
What are the advantages and disadvantages of c language?
What is static volatile in c?
Is c a great language, or what?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What is the scope of global variable in c?
Explain how can I open a file so that other programs can update it at the same time?
Differentiate between Macro and ordinary definition.
Why is structure padding done in c?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
what is the height of tree if leaf node is at level 3. please explain