QP School
Using multi-line comments for explanations in C - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: C 18 Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=32)
+--- Thread: Using multi-line comments for explanations in C (/showthread.php?tid=5133)



Using multi-line comments for explanations in C - Qomplainerz - 07-26-2023

Example:

int x = 5;
int y = 10;
/*
    The following code calculates the sum of two numbers.
    It takes two integers, x and y, as input and returns their sum.
*/
int sum = x + y;

Explanation:

Multi-line comments are often used to provide detailed explanations for code blocks or functions.
In this example, the comment provides an explanation of the code that calculates the sum of two numbers.