Explain following declaration
int *P(void);
and
int (*p)(char *a);
Answers were Sorted based on User's Feedback
Answer / vijay
int* p(void) means p is a function that takes no argument a
return a pointer to integer.
int (*p)(char*a) means that p is a pointer to function that
take character pointer as argument and return an integer.
| Is This Answer Correct ? | 56 Yes | 4 No |
Answer / 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 |
Answer / tibu
int *p(void) - says this is function with null parameter
and returns a pointer to an integer.
int (*p)(char *a) - says this is function with a pointer to
a char a as parameter and returns a pointer to an integer.
| Is This Answer Correct ? | 19 Yes | 19 No |
WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE GIVEN VALUES
What is the advantage of c?
write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" and the o/p should be "cba gfed jih onmlk srqp vut zyxw"
extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i =20; printf("%d \n",i); func(); printf("%d \n",i); }
What is meant by global static? why we have to use static variable instead of Global variable
In which mode we open the file for read,write and append also in c ? a)W b)w+ c)r+ d)a
what about "char *(*(*a[])())();"
How are 16- and 32-bit numbers stored?
What is the use of extern in c?
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
how to impliment 2 or more stacks in a single dimensional array ?