13.07.2015 Views

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>C#</strong> LANGUAGE SPECIFICATION24.1 Attribute classes....................................................................................................................................... 30524.1.1 Attribute usage............................................................................................................................ 30524.1.2 Positional and named parameters................................................................................................ 30624.1.3 Attribute parameter types............................................................................................................ 30724.2 Attribute specification ............................................................................................................................. 30724.3 Attribute instances ................................................................................................................................... 31124.3.1 Compilation of an attribute ......................................................................................................... 31124.3.2 Run-time retrieval of an attribute instance.................................................................................. 31124.4 Reserved attributes .................................................................................................................................. 31224.4.1 The AttributeUsage attribute ............................................................................................. 31224.4.2 The Conditional attribute..................................................................................................... 31224.4.3 The Obsolete attribute............................................................................................................ 31425. Unsafe code .................................................................................................................................................. 31725.1 Unsafe contexts ....................................................................................................................................... 31725.2 Pointer types ............................................................................................................................................ 31925.3 Fixed and moveable variables ................................................................................................................. 32225.4 Pointer conversions ................................................................................................................................. 32225.5 Pointers in expressions ............................................................................................................................ 32325.5.1 Pointer indirection....................................................................................................................... 32425.5.2 Pointer member access................................................................................................................ 32425.5.3 Pointer element access ................................................................................................................ 32525.5.4 The address-of operator .............................................................................................................. 32525.5.5 Pointer increment and decrement................................................................................................ 32625.5.6 Pointer arithmetic........................................................................................................................ 32625.5.7 Pointer comparison ..................................................................................................................... 32725.5.8 The sizeof operator................................................................................................................. 32725.6 The fixed statement.............................................................................................................................. 32825.7 Stack allocation ....................................................................................................................................... 33125.8 Dynamic memory allocation ................................................................................................................... 332A. Grammar....................................................................................................................................................... 335A.1 Lexical grammar....................................................................................................................................... 335A.1.1 Line terminators ........................................................................................................................... 335A.1.2 White space.................................................................................................................................. 335A.1.3 Comments .................................................................................................................................... 335A.1.4 Tokens.......................................................................................................................................... 336A.1.5 Unicode character escape sequences............................................................................................ 336A.1.6 Identifiers ..................................................................................................................................... 336A.1.7 Keywords ..................................................................................................................................... 337A.1.8 Literals ......................................................................................................................................... 338A.1.9 Operators and punctuators ........................................................................................................... 339A.1.10 Pre-processing directives ........................................................................................................... 340A.2 Syntactic grammar.................................................................................................................................... 341A.2.1 Basic concepts.............................................................................................................................. 341A.2.2 Types............................................................................................................................................ 342A.2.3 Variables ...................................................................................................................................... 343A.2.4 Expressions .................................................................................................................................. 343A.2.5 Statements.................................................................................................................................... 346A.2.6 Classes.......................................................................................................................................... 350A.2.7 Structs .......................................................................................................................................... 355A.2.8 Arrays........................................................................................................................................... 355A.2.9 Interfaces...................................................................................................................................... 356A.2.10 Enums ........................................................................................................................................ 357A.2.11 Delegates.................................................................................................................................... 357xii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!