what is # # in C

Discussion in 'C' started by priyapai, Apr 27, 2006.

  1. priyapai

    priyapai New Member

    Joined:
    Mar 24, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    Hi all,

    today i was going thru a code, wer i found this macro definition,


    #define _L(a) (TPtrC((const TText *)L ## a))

    where TPtrC and TText r user defined data-types,

    wat is the ## symbol for..... :confused:



    -priya
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Can you let us have the complete context where you found this.

    [COMMENT]Also try creating the thread in the correct section and only one. I have closed the other thread as duplicate and moved them to the correct section as well.[/COMMENT]
     
  3. sharmila

    sharmila New Member

    Joined:
    Mar 24, 2006
    Messages:
    75
    Likes Received:
    1
    Trophy Points:
    0
  4. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    736
    Likes Received:
    38
    Trophy Points:
    28
    I didn't knew about ## operator. Thanks for the info sharmila.
     
  5. sharmila

    sharmila New Member

    Joined:
    Mar 24, 2006
    Messages:
    75
    Likes Received:
    1
    Trophy Points:
    0
    Its my pleasure.
     
  6. priyapai

    priyapai New Member

    Joined:
    Mar 24, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    i was asked by my senior to review a piece of code, and the statement was part of it....

    it is clear to me now.

    Thanx :)
     
  7. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Nor did I knew about it.
     
  8. Aztec

    Aztec New Member

    Joined:
    May 9, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    0
    Sample code to make things more clear:-

    Code:
    #include<stdio.h>
    #define JOIN(a, b) a ## b
    int main()
    {
    
    printf("%s",JOIN("Hi","Everyone"));
    
    return 0;
    }
     
  9. priyapai

    priyapai New Member

    Joined:
    Mar 24, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    thanx Aztec... :)

    Its clear to me....

    Thanx Forum members for responding to my query


    regards
    Priya :)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice