Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Basics (Retired) Prepare and Plan Preparation and Planning

Multi-Line Comment in C#

Jeremy wrote several lines of comments using single line comments: the 2 back-slashes // I know each language has it's own syntax for this, but does C# have a multi-line comment, and if so, what is it? Thanks!

4 Answers

anil rahman
anil rahman
7,786 Points
/*
   1st comment 
   2nd comment
   3rd comment
*/
Justin Molyneaux
Justin Molyneaux
13,329 Points

To make a multi-line comment, highlight the lines that you wish to comment and press Command / on Mac or Control / on Windows. Repeat this process to uncomment those lines.

Randy Eichelberger
Randy Eichelberger
445 Points

btw he used multiple single line quotes because each one of these is a separate part of the program. It wouldn't make sense to use a multiline comment when you're about to go through and write code between each line.