Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Commenting out a part of a line in C
#1
Example:

int x = 10; // Initialize x to 10
int y = 20; // Initialize y to 20
// int z = x + y; // This line is commented out

Explanation:

Single-line comments can be used to comment out a portion of a line, rather than the entire line.
In this example, the third line is partially commented out to exclude the calculation of z.
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
  Commenting out a block of code in C Qomplainerz 0 607 07-26-2023, 07:25 AM
Last Post: Qomplainerz
  Multi-line comments in C Qomplainerz 0 646 07-26-2023, 07:24 AM
Last Post: Qomplainerz
  Commenting out code in C Qomplainerz 0 666 07-26-2023, 07:17 AM
Last Post: Qomplainerz
  Single-Line comments in C Qomplainerz 0 672 07-26-2023, 07:16 AM
Last Post: Qomplainerz
  Command-Line Arguments in C Qomplainerz 0 633 07-25-2023, 01:27 PM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 2 Guest(s)