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...


Explain following declaration
int *P(void);
and
int (*p)(char *a);

Answers were Sorted based on User's Feedback



Explain following declaration int *P(void); and int (*p)(char *a); ..

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

Explain following declaration int *P(void); and int (*p)(char *a); ..

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

Explain following declaration int *P(void); and int (*p)(char *a); ..

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

Post New Answer

More C Interview Questions

main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

0 Answers   Wilco,


Why flag is used in c?

0 Answers  


to find the program of matrix multiplication using arrays

6 Answers   Bhel,


Is it cc or c in a letter?

0 Answers  


Is it possible to pass an entire structure to functions?

0 Answers  


Where are the auto variables stored?

0 Answers   TISL,


Explain the difference between the local variable and global variable in c?

0 Answers  


how to find the sizof of any datatype using bit manipulations

3 Answers  


what is c

1 Answers  


write a c program to print "Welcome" without using semicolon in the whole program ??

15 Answers   Infosys, TCS,


What is the purpose of clrscr () printf () and getch ()?

0 Answers  


What is external variable in c?

0 Answers  


Categories