Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi-Line comment within code in C
#1
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.
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using multi-line comments for explanations in C Qomplainerz 0 627 07-26-2023, 07:28 AM
Last Post: Qomplainerz
  Nested multi-line comments in C Qomplainerz 0 530 07-26-2023, 07:27 AM
Last Post: Qomplainerz
  Commenting out a block of code in C Qomplainerz 0 556 07-26-2023, 07:25 AM
Last Post: Qomplainerz
  Multi-line comments in C Qomplainerz 0 601 07-26-2023, 07:24 AM
Last Post: Qomplainerz
  Commenting out a part of a line in C Qomplainerz 0 615 07-26-2023, 07:19 AM
Last Post: Qomplainerz
  Single-Line comment within code in C Qomplainerz 0 557 07-26-2023, 07:18 AM
Last Post: Qomplainerz
  Inline comment for code explanation in C Qomplainerz 0 656 07-26-2023, 07:18 AM
Last Post: Qomplainerz
  Commenting out code in C Qomplainerz 0 619 07-26-2023, 07:17 AM
Last Post: Qomplainerz
  Single-Line comments in C Qomplainerz 0 624 07-26-2023, 07:16 AM
Last Post: Qomplainerz
  Writing clean and maintainable code in C Qomplainerz 0 544 07-25-2023, 01:31 PM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 1 Guest(s)