O'Reilly logo

C Programming: Visual Quickstart Guide by Marc Liyanage, Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Comments to Your Source Code

Although they do nothing for the functionality of an application, comments are still a critical part of any programming language. Comments are necessary to remind yourself—while you're initially developing an application or when you come back months later—why you did certain things. These are some of the most common uses for comments:

  • Indicate the purpose of a file

  • Document who created a file and when

  • Note the thinking behind a function

  • Clearly state the meaning of variables

  • Explain why particular numbers are used

  • Mark contingencies or assumptions being made

C supports two comment formats. The first allows you to write comments over multiple lines:

/* Multiline comments
have start and end delineators. */

Some ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required