> Another question about legal comments: can /* comments nest? How > deeply? If I understood from the lecture correctly, a // comment is > ignored inside of a /* comment (i.e. it can't comment out a */)? >
Classic comments cannot nest. This is a problem with comments in C, and is not fixed in the C++ comments. /* i++; /* add one to i */ j++ /* add one to j */ */ becomes j++ /* add one to j */ */ Which is an error. If you want to comment out a block of code that may contain comments in C, you must us something like #if 0 i++; /* add one to i */ j++ /* add one to j */ #endif I don't know how to do this in Java. > > PS. Another interesting comment near quotes: > > "Print out a backslash:\\" /* This is a comment */ Yes, you have to watch for commented character. I claim it that the idea of an FSM still makes this easy. - jeff parker PS You should be wrapping up this assignment, and starting to get ready for HW #1.