1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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,276
    Likes Received:
    364
    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:
    734
    Likes Received:
    37
    Trophy Points:
    0
    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,276
    Likes Received:
    364
    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