QP School
Multi-Line comment within code 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: Multi-Line comment within code in C (/showthread.php?tid=5131)



Multi-Line comment within code in C - Qomplainerz - 07-26-2023

Example:

int age = 25;
/*
if (age >= 18) {
    printf("You are an adult!\n");
    // Handle adult-related actions here
} else {
    printf("You are a minor.\n");
    // Handle minor-related actions here
}
*/

Explanation:

Multi-line comments can be used to temporarily disable a block of code within the code.
In this example, the block of code inside the if and else blocks is commented out, so it won't be executed.
This can be useful for debugging or testing different code paths without deleting the code.