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
What is #line in c?
What are loops c?
How can I do serial ("comm") port I/O?
What’s a signal? Explain what do I use signals for?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
FILE PROGRAMMING
What does %c mean in c?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Where is volatile variable stored?
What is the difference between array and pointer?
What is wrong with this program statement? void = 10;
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
What does != Mean in c?
How can you determine the size of an allocated portion of memory?
What is the difference between arrays and pointers?