X hits on this document





50 / 396

Chapter ‎18   Unsafe code

// Hello, world program // This program writes “hello, world” to the console // class Hello // any name will do for this class { static void Main() { // this method must be named "Main" System.Console.WriteLine("hello, world"); } }

shows several single-line comments.

2.3.3 White space

White space is defined as any character with Unicode class Zs (which includes the space character) as well as the horizontal tab character, the vertical tab character, and the form feed character.

whitespace: Any character with Unicode class Zs Horizontal tab character (U+0009) Vertical tab character (U+000B) Form feed character (U+000C)

2.4 Tokens

There are several kinds of tokens: identifiers, keywords, literals, operators, and punctuators. White space and comments are not tokens, though they act as separators for tokens.

token: identifier keyword integer-literal real-literal character-literal string-literal operator-or-punctuator

2.4.1 Unicode character escape sequences

A Unicode character escape sequence represents a Unicode character. Unicode character escape sequences are processed in identifiers (§‎2.4.2), character literals (§‎, and regular string literals (§‎ A Unicode character escape is not processed in any other location (for example, to form an operator, punctuator, or keyword).

unicode-escape-sequence: \u   hex-digit   hex-digit   hex-digit   hex-digit \U   hex-digit   hex-digit   hex-digit  hex-digit   hex-digit   hex-digit   hex-digit   hex-digit

A Unicode escape sequence represents the single Unicode character formed by the hexadecimal number following the “\u” or “\U” characters. Since C# uses a 16-bit encoding of Unicode code points in characters and string values, a Unicode character in the range U+10000 to U+10FFFF is not permitted in a character literal and is represented using a Unicode surrogate pair in a string literal. Unicode characters with code points above 0x10FFFF are not supported.

Multiple translations are not performed. For instance, the string literal “\u005Cu005C” is equivalent to “\u005Crather than “\”. The Unicode value \u005C is the character “\”.

The example

Copyright Microsoft Corporation 1999-2003. All Rights Reserved.37

Document info
Document views1447
Page views1447
Page last viewedTue Jan 24 01:49:00 UTC 2017