Now, we all know that // makes a comment. But I have a question about the compiling of the program? Say you were to make a comment with a whole bunch of underscores to signify a different section of code. Does the amount of comments written in the source code increase the size of the final executed file or make the program any slower, even by a microsecond? Or does C++ just skip right over the comments or automatically delete them while compiling? Thanks in advance =)
DanDaMan 0 Newbie Poster
Recommended Answers
Jump to Poststilllearning is correct. The compiler is only interested in the statements that do something so comments are not part of the compiled program.
Jump to Post>Does the amount of comments written in the source code increase the size of the
>final executed file or make the program any slower, even by a microsecond?
No, comments are stripped from the source during compilation.
All 5 Replies
stilllearning 148 Posting Whiz
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
DanDaMan 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
Denniz 103 Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.