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
How can I trap or ignore keyboard interrupts like control-c?
Simplify the program segment if X = B then C ← true else C ← false
What is void main ()?
Can math operations be performed on a void pointer?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
What is a program?
How do I copy files?
How do you declare a variable that will hold string values?
What is the difference between malloc() and calloc() function in c language?
What are high level languages like C and FORTRAN also known as?
What is the use of bitwise operator?
What happens if you free a pointer twice?
What are the different types of pointers used in c language?
What is pointer and structure in c?