OneBite.Dev - Coding blog in a bite size

create comments in C

Code snippet on how to create comments in C

  /* This is a comment
   * in C syntax, which is 
   * started with a forward slash 
   * and an asterisk
   */

This code shows how to create a comment in C syntax. Comments are helpful for other developers who read your code, as they can provide context and explanations for code. To start a comment, the code uses a forward slash and an asterisk. The forward slash indicates that the line should be commented out, and the asterisk prevents the compiler from reading the comment as code. Everything that comes after the initial asterisk is part of the comment, so you can write explanations and information that you want other developers to read. When you are finished writing the comment, you just need to add another asterisk and a forward slash to end it.

c