asking for a code explanation

This is a discussion on asking for a code explanation within the C Programming forums, part of the General Programming Boards category; halo, this is the line code #define _CONCAT(a,b) a ## b the one in red colour is the operator i ...

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    5

    Question asking for a code explanation

    halo,

    this is the line code


    #define _CONCAT(a,b) a##b

    the one in red colour is the operator i dont understand.

    what does it mean?

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Did you try looking it up in your C documentation?

    Try this as a place to start... C preprocessor - Wikipedia, the free encyclopedia

    Basically it does what it says it does, it concatenates two values.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    If you wrote
    int _CONCAT(myvar,123);

    The compiler will see
    int myvar123;
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    Oct 2011
    Posts
    5
    hey, thank you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. a little code explanation
    By orhanli1 in forum C Programming
    Replies: 4
    Last Post: 12-27-2010, 12:44 PM
  2. Code explanation
    By Kong_Han_Dao in forum C Programming
    Replies: 4
    Last Post: 02-22-2010, 11:03 AM
  3. need some explanation on this bit of code
    By Masterx in forum C++ Programming
    Replies: 3
    Last Post: 10-07-2009, 11:00 AM
  4. Code Explanation
    By Aliaks in forum C++ Programming
    Replies: 14
    Last Post: 09-26-2009, 10:37 PM
  5. code explanation
    By chasingxsuns in forum C Programming
    Replies: 2
    Last Post: 02-04-2006, 12:47 AM

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