Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   C++ declarative syntax (http://www.velocityreviews.com/forums/t746686-c-declarative-syntax.html)

muler 04-12-2011 11:32 AM

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,

Victor Bazarov 04-12-2011 01:08 PM

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

muler 04-12-2011 01:54 PM

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.

Victor Bazarov 04-12-2011 02:20 PM

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57