CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Location
    China,P.R.C
    Posts
    24

    How does VC parse typedef void(*FUNC)();

    typedef allow us to define an alias name for a type.
    For simple typedef statment such as
    typedef int A;
    the implemetation is straight forward-- just subsitute A as int;
    but when it comes to more complex form,such as function pointer type,

    typedef void (*FUNC)();

    defines FUNC as a void (*)() type. How does a compiler implement this?
    Every day is a new day.

  2. #2
    Join Date
    Apr 1999
    Location
    Altrincham, England
    Posts
    4,470
    It's a pointer to a function returning void and taking no arguments (or having an unspecified argument list, if it's C rather than C++).
    Correct is better than fast. Simple is better than complex. Clear is better than cute. Safe is better than insecure.
    --
    Sutter and Alexandrescu, C++ Coding Standards

    Programs must be written for people to read, and only incidentally for machines to execute.

    --
    Harold Abelson and Gerald Jay Sussman

    The cheapest, fastest and most reliable components of a computer system are those that aren't there.
    -- Gordon Bell


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured