Hello Guys,
Can you explain,
What's the difference between // comments, /* */ comments and /// comments?
Thanks
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted Jul 12, 2011, 12:25 AM
/* */ is used to comment an entire block like functions/ more than one line.
/*
this
is the same
for block comment
*/
/// As Sam said, is used to generate the xml documentation.
Hope you understood the difference.
Sam HobbsPosted Jul 11, 2011, 11:57 PM
The triple-slash ("///") are for XML comments that the Visual Studio IDE does special things for. The other two are consistent with C/C++ so C# does the same. If it was important, you could research the history of C to determine why the two types of comments exist.