QP School

Full Version: Single-Line comments in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In C, single-line comments are used to add explanatory notes or comments to the code that are ignored by the compiler. They begin with the double forward slash // and continue until the end of the line.

Example: Basic Single-Line Comment

// This is a single-line comment

Explanation:

In this example, the single-line comment starts with //.
Anything after // on the same line is considered a comment and is ignored by the compiler.
This comment serves as a simple explanatory note for the code.