Monday, 19 July 2010

Comments in C

In computer programming, a comment is a programmer-readable annotation in the source code of a computer program.

They are added with the purpose of making the source code easier to understand, and are generally ignored by compilers and interpreters.

There are two types:
1. Single Line
2. Multi Line




Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?


Placing comment symbols /* */ around a code, also referred to as “commenting out”, is a way of isolating some codes that you think maybe causing errors in the program, without deleting the code. The idea is that if the code is in fact correct, you simply remove the comment symbols and continue on. It also saves you time and effort on having to retype the codes if you have deleted it in the first place.

No comments:

Post a Comment