Skip to Main Content
The C# Programming Language, Third Edition
book

The C# Programming Language, Third Edition

by Anders Hejlsberg, Mads Torgersen, Scott Wiltamuth, Peter Golde
October 2008
Intermediate to advanced content levelIntermediate to advanced
784 pages
18h 11m
English
Addison-Wesley Professional
Content preview from The C# Programming Language, Third Edition

18. Unsafe Code

The core C# language, as defined in the preceding chapters, differs notably from C and C++ in its omission of pointers as a data type. Instead, C# provides references and the ability to create objects that are managed by a garbage collector. This design, coupled with other features, makes C# a much safer language than C or C++. In the core C# language, it is simply not possible to have an uninitialized variable, a “dangling” pointer, or an expression that indexes an array beyond its bounds. These constraints eliminate whole categories of bugs that routinely plague C and C++ programs.

Although practically every pointer type construct in C or C++ has a reference type counterpart in C#, nonetheless, there are situations where access ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C Programming Language, 2nd Edition

C Programming Language, 2nd Edition

Brian W. Kernighan, Dennis Ritchie
Learn C# Programming

Learn C# Programming

Marius Bancila, Prakash Tripathi, Raffaele Rialdi, Ankit Sharma
Programming C#

Programming C#

Jesse Liberty
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 9780321592279Purchase book