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
Is it fine to write void main () or main () in c?
write a program for the normal snake games find in most of the mobiles.
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
how to print the character with maximum occurence and print that number of occurence too in a string given ?
What is calloc malloc realloc in c?
How many types of sorting are there in c?
Explain what are the different data types in c?
What are the uses of null pointers?
How will you write a code for accessing the length of an array without assigning it to another variable?
Can you please explain the scope of static variables?
What is a nested loop?
Why can’t constant values be used to define an array’s initial size?
What is the purpose of macro in C language?
What is the use of define in c?
How can I do graphics in c?