Poll: Was this article helpful for you?
You do not have permission to vote in this poll.
Yes
100.00%
1 100.00%
No
0%
0 0%
Total 1 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Single Line Comments in C 18
#1
Single line comments span over one line only and are ignored by the compiler.
In C they can be done with a double Slash.
In this case we do NOT need a semicolon at the end of the line.
Example:

#include <stdio.h>

int main()
{
    // This is a single line comment

    return 0;
}
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
  Storing a single character in C Qomplainerz 0 362 07-26-2023, 07:45 AM
Last Post: Qomplainerz
  Using multi-line comments for explanations in C Qomplainerz 0 342 07-26-2023, 07:28 AM
Last Post: Qomplainerz
  Nested multi-line comments in C Qomplainerz 0 264 07-26-2023, 07:27 AM
Last Post: Qomplainerz
  Multi-line comments in C Qomplainerz 0 335 07-26-2023, 07:24 AM
Last Post: Qomplainerz
  Commenting out a part of a line in C Qomplainerz 0 340 07-26-2023, 07:19 AM
Last Post: Qomplainerz
  Single-Line comment within code in C Qomplainerz 0 285 07-26-2023, 07:18 AM
Last Post: Qomplainerz
  Single-Line comments in C Qomplainerz 0 339 07-26-2023, 07:16 AM
Last Post: Qomplainerz
  Command-Line Arguments in C Qomplainerz 0 283 07-25-2023, 01:27 PM
Last Post: Qomplainerz
  Multi Line Comments in C 18 Qomplainerz 0 815 04-06-2022, 02:24 PM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 4 Guest(s)