Thread: Bug in MSVC++ 6?

  1. #1
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361

    Bug in MSVC++ 6?

    Is this how comments/strings are supposed to interact?
    Doesn't seem very right to me.

  2. #2
    That's not a bug, its bad syntax on the coders part

    When the "/*" symbol is encountered outside of a string it will look for the next ending symbol "*/".

    It doesn't care about anything past the "/*" symbol since you are specifying that everything past that symbol is a comment until the ending symbol
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  3. #3
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    No it's not a bug. It's doing exactly what you want it to do, you put a /* and it looks for the next */. Why in the hell are you doing that stuff that way anyway? If you really want to comment it out just paste it into another text file in the project and cut it from that one. And if you want to leave it in, just put a // on the line that has the */ that wasn't supposed to end the comment. They probably should have included something that looks for quotations but they didn't, not a bug, just something they didn't think of.
    PHP and XML
    Let's talk about SAX

  4. #4
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    That's not a bug, its bad syntax on the coders part

    When the "/*" symbol is encountered outside of a string it will look for the next ending symbol "*/".

    It doesn't care about anything past the "/*" symbol since you are specifying that everything past that symbol is a comment until the ending symbol
    Obviously
    but the thing is, it's in a string. I just found it odd
    I had it programmed the other way in my CPP->HTML converter (strings taking precidence over comments) but I guess i'll have to change it.

    No it's not a bug. It's doing exactly what you want it to do, you put a /* and it looks for the next */. Why in the hell are you doing that stuff that way anyway? If you really want to comment it out just paste it into another text file in the project and cut it from that one. And if you want to leave it in, just put a // on the line that has the */ that wasn't supposed to end the comment. They probably should have included something that looks for quotations but they didn't, not a bug, just something they didn't think of.
    It's called commenting out, you do it portions of code which are no longer needed, but may be needed in the future.
    I don't need any alternatives, I just found this to be quite odd...
    Normally when something is in a string, it's treated as a string.

  5. #5
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    >Normally when something is in a string, it's treated as a string.

    think of it like this, the comment takes precedence since the opening ' " ' of the string is part of the comment, so it is not the start of a string.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gaks bug?
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-31-2008, 02:47 PM
  2. ATL bug of CComPtr?
    By George2 in forum Windows Programming
    Replies: 6
    Last Post: 04-07-2008, 07:52 AM
  3. MSVC 2k3 7.1 bug?
    By RITZ in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2006, 02:50 PM
  4. MSVC resource script in Dev-C++
    By josh_d in forum Windows Programming
    Replies: 0
    Last Post: 03-17-2004, 04:07 PM
  5. GCC (cygwin) much faster than MSVC, Borland?
    By Sargnagel in forum C Programming
    Replies: 15
    Last Post: 08-05-2003, 03:15 AM