4.A function 'q' that accepts a pointer to a character as
argument and returns a pointer to an array of integer can
be declared as:
A)int (*q(char*)) []
B)int *q(char*) []
C)int(*q)(char*) []
D)None of the Above
Answer Posted / garima singh
EVERY ONE HERE IS WRONG...I HAVE READ SOME NOTES AND GOT THE
OPTION 'A' AS CORRECT...
THERE ARE SEVERAL DIFFERENT USES OF POINTERS IN C...THEY ARE
1) int *p;
// p is a pointer to an integer quantity
(2) int *p[10];
// p is a 10-element array of pointers to integer quantities
(3) int (*p)[10];
// p is a pointer to a 10-element integer array
(4) int *p(void);
// p is a function that returns a pointer to an integer quantity
(5) int p(char *a);
// p is a function that accepts an argument which is a
pointer to a
character returns an
// integer quantity
(6) int *p(char *a);
// p is a function that accepts an argument which is a
pointer to a
character returns a
// pointer to an integer quantity
(7) int (*p)(char *a);
// p is pointer to a function that accepts an argument which
is a
pointer to a character
// returns an integer quantity
(8) int (*p(char *a))[10];
// p is a function that accepts an argument which is a
pointer to a
character returns a
// pointer to a 10-element integer array
(9) int p(char (*a)[]);
// p is a function that accepts an argument which is a
pointer to a
character array returns
// an integer quantity
(10) int p(char *a[]);
// p is a function that accepts an argument which is a array of
pointers to characters
// returns an integer quantity
(11) int *p(char a[]);
// p is a function that accepts an argument which is a
character
array
returns a pointer to
// to an integer quantity
(12) int *p(char (*a)[]);
// p is a function that accepts an argument which is a
pointer to a
character array returns a
// pointer to an integer quantity
(13) int *p(char *a[]);
// p is a function that accepts an argument which is an array of
pointers to characters
// returns a pointer to an integer quantity
(14) int (*p)(char (*a)[]);
// p is pointer to a function that accepts an argument which
is a
pointer to a character array
// returns an integer quantity
(15) int *(*p)(char (*a)[]);
// p is pointer to a function that accepts an argument which
is a
pointer to a character array
// returns a pointer to an integer quantity
(16) int *(*p)(char *a[]);
// p is pointer to a function that accepts an argument which
is a
array
of pointers to
// characters returns a pointer to an integer quantity
(17) int (*p[10])(void);
// p is 10-element array of pointers to functions; each
function
returns
an integer quantity
(18) int (*p[10])(char a);
// p is 10-element array of pointers to functions; each function
accepts an argument which is
// a character and returns an integer quantity
(19) int *(*p[10])(char a);
// p is 10-element array of pointers to functions; each function
accepts an argument which is
// a character and returns a pointer to an integer quantity
(20) int *(*p[10])(char *a);
// p is 10-element array of pointers to functions; each function
accepts an argument which is
// a pointer to a character and returns a pointer to an integer
quantity
SO,ACCORDING TO NUMBER 8...OPTION A IS CORRECT!!!
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
Does free set pointer to null?
How many loops are there in c?
How do you initialize pointer variables?
What does typedef struct mean?
What are the benefits of c language?
Is register a keyword in c?
What does the format %10.2 mean when included in a printf statement?
What is a class c rental property?
What is ambagious result in C? explain with an example.
Why isn't it being handled properly?
Explain what math functions are available for integers? For floating point?
What are identifiers in c?
How can I discover how many arguments a function was actually called with?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?