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


Please Help Members By Posting Answers For Below Questions

Is it fine to write void main () or main () in c?

759


write a program for the normal snake games find in most of the mobiles.

2041


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

879


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2259


What is calloc malloc realloc in c?

833


How many types of sorting are there in c?

842


Explain what are the different data types in c?

973


What are the uses of null pointers?

807


How will you write a code for accessing the length of an array without assigning it to another variable?

844


Can you please explain the scope of static variables?

819


What is a nested loop?

888


Why can’t constant values be used to define an array’s initial size?

1126


What is the purpose of macro in C language?

876


What is the use of define in c?

821


How can I do graphics in c?

797