【正文】
Copyright ? Microsoft Corporation 19992020. All Rights Reserved. C Language Reference Owners: Anders Hejlsberg and Scott Wiltamuth File: C Language Last saved: 9/27/2020 Last printed: 9/27/2020 Version Copyright ? Microsoft Corporation 19992020. All Rights Reserved. Notice This documentation is an early release of the final documentation, which may be changed substantially prior to final mercial release, and is information of Microsoft Corporation. This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information in this document is subject to change without notice. The entire risk of the use or the results of the use of this document remains with the user. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Unpublished work. 169。 19992020 Microsoft Corporation. All rights reserved. Microsoft, Windows, Visual Basic, and Visual C++ are either registered trademarks or trademarks of Microsoft Corporation in the . and/or other countries. Other product and pany names mentioned herein may be the trademarks of their respective owners. Table of Contents Copyright ? Microsoft Corporation 19992020. All Rights Reserved. iii Table of Contents 1. Introduction ............................................................................................................................................1 Hello, world ........................................................................................................................................1 Automatic memory management ..........................................................................................................2 Types..................................................................................................................................................4 Predefined types ..................................................................................................................................5 Array types .........................................................................................................................................7 Type system unification .......................................................................................................................9 Statements ........................................................................................................................................ 10 Statement lists and blocks ............................................................................................................10 Labeled statements and goto statements.......................................................................................10 Local declarations of constants and variables ................................................................................11 Expression statements..................................................................................................................11 The if statement...........................................................................................................................11 The switch statement ...................................................................................................................12 The while statement.....................................................................................................................12 The do statement .........................................................................................................................13 The for statement ........................................................................................................................13 The foreach statement .............................................................................................................13 The break statement and the continue statement .....................................................................14 The return statement ...............................................................................................................14 The throw statement .................................................................................................................14 The try statement .....................................................................................................................14 The checked and unchecked statements ..................................................................................14 The lock statement ...................................................................................................................14 Classes.............................................................................................................................................. 14 Structs .............................................................................................................................................. 15 Interfaces ........................................................................................................................................ 15 Deleg