About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.
Sean Sexton
Recent Posts
Calendar
Top Posts
- #13 - Specify Command Line Arguments in Visual Studio 2010
- #519 - Differences Between structs and classes
- #143 - An Example of Implementing ICloneable for Deep Copies
- #591 - How Optional Parameters Look with Intellisense
- #261 - How Automatic Properties Look Under-the-Covers
- #595 - Intellisense Shows Method Overloads
- #45 - Static Members of a Class
- #24 - Character Literals
- #507 - You can #define Other Symbols within a #if Block
- #60 - Using Parse to Convert from String to Numeric Types
Tags
#define
#if
== operator
Accessibility
Arguments
Array
Arrays
Basics
C#
Class
Classes
Constants
Constructor
Constructors
Data Types
Deep Copy
Delegate
Delegates
Enum
Enumeration
Equality
Equals
Events
Generics
Heap
Inheritance
Intellisense
Interfaces
Literals
Main
Methods
Namespaces
new
Nullable
Operators
Optional Parameters
Parameters
Polymorphism
Properties
Reference Types
Static
Strings
struct
Value Types
Visual Studio
Blog Stats
- 84,220 hits
#475 – Comments Occuring within String Literals Are Treated as Part of the String
December 14, 2011 Leave a comment
Recall that comments in C# can be of two forms–either single line or delimited comments.
// This is a single line comment int x = 12; // So is this /* Delimited comment here */ /* This is * a multiline delimited comment * comment */If something that looks like a comment appears within a string, it isn’t treated by the compiler as a comment, but just as part of the string.
Console.WriteLine("A C# comment looks like this: // This is a comment"); Console.WriteLine("It might also look like this: /* Good morning Pompeii */");Share this:
Like this:
Filed under Basics Tagged with Basics, C#, Comments