plz help with a c++ macro
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: plz help with a c++ macro

  1. #1
    Join Date
    Nov 2008
    Posts
    9

    plz help with a c++ macro

    can someone please explain the meaning/purpose of this macro?

    #define myMacro(a, b) ( (int) &( ( ( a * ) 0 )->b ) )


    Thanks!!

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,245

    Re: plz help with a c++ macro

    In what context did you see this used? I cannot really discern its purpose as it looks like it may involve dereferencing a null pointer.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    May 2001
    Location
    Germany
    Posts
    1,108

    Re: plz help with a c++ macro

    this looks pretty much like the "offsetof" macro/function in C

  4. #4
    Join Date
    Apr 2007
    Location
    Mars NASA Station
    Posts
    1,436

    Re: plz help with a c++ macro

    Thanks for your help.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center