Monday, August 8, 2011

Chapter 2, question 3

3.  How do you add program comments, and why are they used?

I start a comment with /* and end it with */

/* So, this is a comment. */

If I'm using C99, I can also start a comment with //

// This is a C99 comment.

The reason why I use comments is to explain my source code to any person reading it (which could be myself).  This makes my code more maintainable, self-documenting, and hopefully stops bugs from occurring.

No comments:

Post a Comment