Defines and Comments

This is a discussion on Defines and Comments within the C++ Programming forums, part of the General Programming Boards category; The '//' is a comment-thing...but how would you make like a # a comment-thing? I've tried PHP Code: #define ' //  But ...

  1. #1
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644

    Defines and Comments

    The '//' is a comment-thing...but how would you make like a # a comment-thing? I've tried
    PHP Code:
    #define ' // 
    But it didn't work

  2. #2
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    I'm almost sure that it wouldn't work, but I'm not sure why? I think it might be because macros only work compiled code, and comments are not compiled.
    none...

  3. #3
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    Well it wouldn't work because macro names must be identifiers. And ' isn't one.

    You could however do something with an identifier, like for example #define'ing COMMENT to be //.

    But the usefulness of such a thing is not immediately apparent.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multi file source to single file source
    By anonytmouse in forum Tech Board
    Replies: 4
    Last Post: 12-07-2003, 08:47 AM

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