CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
Difference between Funtion to pointer and pointer to function


Category C Interview Questions
Rating (3.0) By 1 users
Added on 7/19/2006
Views 2025
Rate it!
Answers:

just go thru the two examples written below, to clarify this doubt

ex of pointer to function:

int (*function name)(Argument1,Argument2..)

The above decleration explains that its an pointer to a function whose return type is an intiger.

ex of function to pointer :

int *function name(Argument1,Argument2..)

The above declaration expalains that a function teturns a pointer to an intiger quantity.



The question as written is meaningless.

The term 'function to a pointer' doesn't exist in standard C.

In the answer the 'function to a pointer' example is a function prototype that returns a pointer to an integer, therefore the question should be rephrased 'What is the difference between a pointer to a function and a function that returns a pointer?'

And if you don't know the answer to that, we should end the interview right here...



 Posted by: Joel Corley    

Contact Joel Corley  Contact Joel Corley


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is #line used for?


View Answer
Can a variable be both const and volatile?


View Answer
All the programs are tested under Turbo C/C++ compilers.
It is assumed that,
?? Programs run under DOS environment,
?? The underlying machine is an x86 system,
?? Program is compiled using Turbo C/C++ compiler.
The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed).

Predict the output or error(s) for the following:

i) void main()
{
int const * p=5;
printf("%d",++(*p));
}


View Answer
main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}


View Answer
vi) main()
{
extern int i;
i=20;
printf("%d",i);
}


View Answer
vii)7. main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
}


View Answer
viii) main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
}


View Answer
main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
}


View Answer
x) main()
{
printf("%x",-1<<4);
}


View Answer
What is pointer?

View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/6053/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.64