# operator

Discussion in 'C++' started by xuatla, Jan 22, 2007.

  1. xuatla

    xuatla Guest

    Hi,

    Anyone know some description about # operator in C++?

    I just saw this recently in the macro definition, e.g.,

    #define printAsIs(letter) #letter

    Now I understand that it simply converts the argument letter to a
    string. But I couldn't find any reference online by myself. Any other
    usage of '#' in C++ besides this?

    Thanks.
    - X
     
    xuatla, Jan 22, 2007
    #1
    1. Advertisements

  2. xuatla wrote:
    > Anyone know some description about # operator in C++?
    >
    > I just saw this recently in the macro definition, e.g.,
    >
    > #define printAsIs(letter) #letter
    >
    > Now I understand that it simply converts the argument letter to a
    > string. But I couldn't find any reference online by myself. Any other
    > usage of '#' in C++ besides this?


    No.

    http://www.google.com/search?num=100&hl=en&lr=&q=C preprocessor operators

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Jan 22, 2007
    #2
    1. Advertisements

  3. xuatla

    xuatla Guest

    Got it. Thanks!

    - X

    Victor Bazarov wrote:
    > xuatla wrote:
    > > Anyone know some description about # operator in C++?
    > >
    > > I just saw this recently in the macro definition, e.g.,
    > >
    > > #define printAsIs(letter) #letter
    > >
    > > Now I understand that it simply converts the argument letter to a
    > > string. But I couldn't find any reference online by myself. Any other
    > > usage of '#' in C++ besides this?

    >
    > No.
    >
    > http://www.google.com/search?num=100&hl=en&lr=&q=C preprocessor operators
    >
    > V
    > --
    > Please remove capital 'A's when replying by e-mail
    > I do not respond to top-posted replies, please don't ask
     
    xuatla, Jan 23, 2007
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jakob Bieling

    Q: operator void* or operator bool?

    Jakob Bieling, Mar 5, 2004, in forum: C++
    Replies:
    2
    Views:
    680
    Rob Williscroft
    Mar 5, 2004
  2. John Smith
    Replies:
    2
    Views:
    473
    Ivan Vecerina
    Oct 6, 2004
  3. Alex Vinokur
    Replies:
    4
    Views:
    3,122
    Peter Koch Larsen
    Nov 26, 2004
  4. Alex Vinokur
    Replies:
    3
    Views:
    5,117
    Jeff Schwab
    Mar 20, 2005
  5. Tim Clacy
    Replies:
    15
    Views:
    2,829
    Kanenas
    May 30, 2005
Loading...

Share This Page