QP School

Full Version: Inline comment for code explanation in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Example:

int result = add(5, 10); // Call the add function with arguments 5 and 10

Explanation:

Single-line comments can be placed after code statements to provide explanations or reminders for the purpose of that code.
In this example, the comment explains the purpose of the code and what the function call does.