Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using multi-line comments for explanations in C
#1
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.
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
  Nested multi-line comments in C Qomplainerz 0 1,248 07-26-2023, 07:27 AM
Last Post: Qomplainerz
  Multi-Line comment within code in C Qomplainerz 0 1,348 07-26-2023, 07:26 AM
Last Post: Qomplainerz
  Multi-line comments in C Qomplainerz 0 1,268 07-26-2023, 07:24 AM
Last Post: Qomplainerz
  Commenting out a part of a line in C Qomplainerz 0 1,386 07-26-2023, 07:19 AM
Last Post: Qomplainerz
  Single-Line comments in C Qomplainerz 0 1,290 07-26-2023, 07:16 AM
Last Post: Qomplainerz
  Command-Line Arguments in C Qomplainerz 0 1,373 07-25-2023, 01:27 PM
Last Post: Qomplainerz
  Multi-dimensional arrays in C Qomplainerz 0 1,164 07-25-2023, 11:40 AM
Last Post: Qomplainerz
  Multi Line Comments in C 18 Qomplainerz 0 1,626 04-06-2022, 02:24 PM
Last Post: Qomplainerz
  Single Line Comments in C 18 Qomplainerz 0 2,550 04-06-2022, 02:22 PM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 1 Guest(s)