![]() |
C++ declarative syntax
Q. Write a function declaration that takes a double argument and
returns a pointer to a function that takes an int argument and returns a pointer to char without using a typedef? using a typedef, it's easy: typedef char* (*Ptr_func)(int); Ptr_fun Func(double); Thanks, |
Re: C++ declarative syntax
On 4/12/2011 7:32 AM, muler wrote:
> Q. Write a function declaration that takes a double argument and > returns a pointer to a function that takes an int argument and returns > a pointer to char without using a typedef? That's not a question (even if you end it with a question mark). It's an assignment. > > using a typedef, it's easy: > > typedef char* (*Ptr_func)(int); > Ptr_fun Func(double); We don't do assignments. FAQ 5.2. V -- I do not respond to top-posted replies, please don't ask |
Re: C++ declarative syntax
On Apr 12, 4:08*pm, Victor Bazarov <v.baza...@comcast.invalid> wrote:
> On 4/12/2011 7:32 AM, muler wrote: > > > Q. Write a function declaration that takes a double argument and > > returns a pointer to a function that takes an int argument and returns > > a pointer to char without using a typedef? > > That's not a question (even if you end it with a question mark). *It's > an assignment. > > > > > using a typedef, it's easy: > > > typedef char* (*Ptr_func)(int); > > Ptr_fun Func(double); > > We don't do assignments. *FAQ 5.2. > > V > -- > I do not respond to top-posted replies, please don't ask it was just out of curiosity i asked that. |
Re: C++ declarative syntax
On 4/12/2011 9:54 AM, muler wrote:
> On Apr 12, 4:08 pm, Victor Bazarov<v.baza...@comcast.invalid> wrote: >> On 4/12/2011 7:32 AM, muler wrote: >> >>> Q. Write a function declaration that takes a double argument and >>> returns a pointer to a function that takes an int argument and returns >>> a pointer to char without using a typedef? >> >> That's not a question (even if you end it with a question mark). It's >> an assignment. >> >> >> >>> using a typedef, it's easy: >> >>> typedef char* (*Ptr_func)(int); >>> Ptr_fun Func(double); >> >> We don't do assignments. FAQ 5.2. >> >> V >> -- >> I do not respond to top-posted replies, please don't ask > > it was just out of curiosity i asked that. Sure. |
| All times are GMT. The time now is 01:02 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.