🔒 Locked
// vs. /**/
Advertisement
Original Post
// comment
/* Comment that is very long. So long, in fact, that in order
to present it correctly, it''s necessary to use several lines.
*/
#if 0
commented.out(code);
#if 0
which.can = be.nested; /* including comments */
#endif
but = must ? be : syntactically - correct;
#endif
How appropriate. You fight like a cow.
quote:
Original post by daerid
actually, I don''t think that it must be syntactically correct. Anything between an #if/endif preprocessor block that evaluates to false/0 doesn''t get included in the compilation proccess at all.
It has to fit the syntax of the preprocessor because the preprocessor still has to evaluate it. Granted, the preprocessor doesn''t understand all of C''s syntax, but a notable exception would be that it understands string literals. (#define''s don''t affect the content of a string literal) So, for instance, you have to at least make sure you properly nest your quote marks. Also think a backslash at the end of a line might cause problems, depending on the context.
As an alternative to trying to figure out if "/**/" or "//" is faster, consider optimizing away the entire comment.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement