Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



4.A function 'q' that accepts a pointer to a character as argument and returns a pointer..

Answer / ravi

correct ans is option C

that is
int (*q)(char*)[]

Is This Answer Correct ?    12 Yes 1 No

4.A function 'q' that accepts a pointer to a character as argument and returns a pointer..

Answer / rani

int *q(char*)[] can be a proper answer

Is This Answer Correct ?    4 Yes 1 No

4.A function 'q' that accepts a pointer to a character as argument and returns a pointer..

Answer / s.srinivasulu

correct ans is option C

that is
int (*q)(char*)[]

Is This Answer Correct ?    4 Yes 1 No

4.A function 'q' that accepts a pointer to a character as argument and returns a pointer..

Answer / sambuddha

THE ANSWER WILL BE
D)NONE OF THE ABOVE

THE CORRECT WAY TO DECLARE IT WILL BE

int * q(char * );

ret_type func_name(arg); is a general function declaration.

ret_type is pointer to an array of integer i.e, int *

arg is accepts a pointer to a character i.e, char *

Is This Answer Correct ?    2 Yes 0 No

4.A function 'q' that accepts a pointer to a character as argument and returns a pointer..

Answer / 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

4.A function 'q' that accepts a pointer to a character as argument and returns a pointer..

Answer / d

general rule: read left to right strating from inner braces

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

C program to read the integer and calculate sum and average using single dimensional array

0 Answers  


What does %p mean c?

0 Answers  


What is undefined behavior?

1 Answers  


What are the languages are portable and platform independent?Why they are like that?

1 Answers   Excel, Satyam,


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

0 Answers  


Why c is called free form language?

0 Answers  


Find the largest number from the given 2 numbers without using any loops and the conditional operator.

2 Answers  


what is difference between array of characters and string

18 Answers   Accenture, Nest,


Famous puzzles which are generally asked by companies during interviews ?

1 Answers   3D PLM, Yahoo,


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

0 Answers   Reliance,


difference between loading and linking

1 Answers  


What is the purpose of #pragma directives in C?

2 Answers  


Categories