X hits on this document





58 / 396

Chapter ‎18   Unsafe code

Each string literal does not necessarily result in a new string instance. When two or more string literals that are equivalent according to the string equality operator (§‎7.9.7) appear in the same assembly, these string literals refer to the same string instance. For instance, the output produced by

class Test { static void Main() { object a = "hello"; object b = "hello"; System.Console.WriteLine(a == b); } }

is True because the two literals refer to the same string instance. The null literal

null-literal: null

The type of a null-literal is the null type.

2.4.5 Operators and punctuators

There are several kinds of operators and punctuators. Operators are used in expressions to describe operations involving one or more operands. For example, the expression a + b uses the + operator to add the two operands a and b. Punctuators are for grouping and separating.

operator-or-punctuator:  one of {}[]().,:; +-*/%&|^!~ =<>?++--&&||<<>> ==!=<=>=+=-=*=/=%=&= |=^=<<=>>=->

2.5 Pre-processing directives

The pre-processing directives provide the ability to conditionally skip sections of source files, to report error and warning conditions, and to delineate distinct regions of source code. The term “pre-processing directives” is used only for consistency with the C and C++ programming languages. In C#, there is no separate pre-processing step; pre-processing directives are processed as part of the lexical analysis phase.

pp-directive: pp-declaration pp-conditional pp-line pp-diagnostic pp-region

The following pre-processing directives are available:

#define and #undef, which are used to define and undefine, respectively, conditional compilation symbols ‎2.5.3).

#if, #elif, #else, and #endif, which are used to conditionally skip sections of source code (§‎2.5.4).

#line, which is used to control line numbers emitted for errors and warnings (§‎2.5.7).

#error and #warning, which are used to issue errors and warnings, respectively (§‎2.5.5).

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

Document info
Document views1230
Page views1230
Page last viewedThu Jan 19 16:03:49 UTC 2017