Thread: asking for a code explanation

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,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.

  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, 01:44 PM
  2. Code explanation
    By Kong_Han_Dao in forum C Programming
    Replies: 4
    Last Post: 02-22-2010, 12:03 PM
  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, 01:47 AM