User Tools

Site Tools


crawdad:programming:comments

Comments

Comments are text inserted into the code that the programmer can read, but the compiler skips. In C, comments are surrounded by a /* */ pair, as in the welcome.c example. In C++, comments can be either C-style or by beginning the line with “//”. Examples:

/* This is a C-style comment */
// This is a C++-style comment

Note: It is extremely important to document your code with appropriate comments, particularly when dealing with complicated scientific code, whose purpose can be difficult to glean by looking at the source.

crawdad/programming/comments.txt · Last modified: 2011/07/05 21:43 by crawdad