What is "..." and "##"

This is a discussion on What is "..." and "##" within the C++ Programming forums, part of the General Programming Boards category; Code: #define INFO(fmt, args...) { SYS_INFO( fmt, ## args ); } What is "..." and "##" here?...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    284

    What is "..." and "##"

    Code:
    #define INFO(fmt, args...) { SYS_INFO( fmt, ## args ); }
    What is "..." and "##" here?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,691
    Here's gcc's documentation on it: http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html

    gg

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,522
    Keep in mind it is not standard C or C++. It is an extension specific to gcc.

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    ## is in 6.10.3.3 in ISO/IEC 9899:TC2.

    ... is also in there spread around.
    Last edited by robwhit; 01-02-2008 at 09:01 PM.

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,522
    You're correct that ## is in the C standards and the C++ standard as a preprocessor directive for token pasting, rob. However, the usage above, which is concerned with defining macros with variable argument lists, is specific to gcc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Use of "?" ":"
    By MK27 in forum C Programming
    Replies: 6
    Last Post: 12-03-2008, 03:21 AM
  2. What does "{}" mean in C++?
    By meili100 in forum C++ Programming
    Replies: 11
    Last Post: 01-04-2008, 05:41 PM
  3. What does these lines do after ":" mark?
    By asilter in forum C++ Programming
    Replies: 7
    Last Post: 09-27-2007, 08:31 AM
  4. parse error before "{" token
    By getout in forum C Programming
    Replies: 4
    Last Post: 12-31-2006, 01:26 PM
  5. Replies: 3
    Last Post: 11-11-2003, 03:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21