C++ declarative syntax

Discussion in 'C++' started by muler, Apr 12, 2011.

  1. muler

    muler Guest

    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,
    muler, Apr 12, 2011
    #1
    1. Advertising

  2. 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
    Victor Bazarov, Apr 12, 2011
    #2
    1. Advertising

  3. muler

    muler Guest

    On Apr 12, 4:08 pm, Victor Bazarov <> 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.
    muler, Apr 12, 2011
    #3
  4. On 4/12/2011 9:54 AM, muler wrote:
    > On Apr 12, 4:08 pm, Victor Bazarov<> 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.
    Victor Bazarov, Apr 12, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MS Newsgroups

    Declarative Security in ASP .net

    MS Newsgroups, Oct 17, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    437
    Natty Gur
    Oct 19, 2003
  2. =?Utf-8?B?VGltbQ==?=
    Replies:
    11
    Views:
    3,590
    Angna
    Jun 29, 2006
  3. drop
    Replies:
    0
    Views:
    276
  4. Nathan Sokalski
    Replies:
    0
    Views:
    285
    Nathan Sokalski
    Apr 2, 2008
  5. muler

    C++ declarative syntax

    muler, Apr 12, 2011, in forum: C++
    Replies:
    2
    Views:
    258
    muler
    Apr 12, 2011
Loading...

Share This Page