User Program Communication

Commenting in C#

Comments are blocks or lines of text ignored by the compiler, used to provide notes about the code.


Syntax
/// A single line text comment
/* A block comment, 
containing multiple lines
*/ 

Notes

Can be used for documentation, code descriptions, resource inclusion, readability, debugging, and any other note that the programmer would like to include.

For the /// comment, the compiler will ignore everything from /// to the end of the line.

For the /* */ comment, the compiler will ignore everything from /* to the closing */.


Example
/*
Hello World console program
*/
Console.WriteLine("Hello World!"); ///Outputs "Hello, World!"

See Also
Documentation

Adding Comments in C# Code - MSDN

Add to Slack

< Write to Console   |   User Input >

© 2019 SyntaxDB. All Rights Reserved.