12.1 As a VC++ programmer, what should I look out for when using C#?


1] The conditionals in if-statements must calculate to a boolean value. You cannot write something like

if (nUnits) { ... }

where nUnits is a int.

2] All code must reside in a class. There are no global variables per se.

3] Bitwise & and | operators can be used with boolean types as logical operators. The && and || operators are also used, and do have the "short-cut calculation" behavior found in C++. The & and | operators do not have this ""short-cut calculation" behavior.

4] Pointers are not available in managed code.

5] In managed code, destructors are not hit immediately when as object goes out of scope. Ie, there is no deterministic destruction.

© 2001-2010 Copyright Syncfusion Inc. All rights reserved.  |  Privacy Policy  |  Contact  |  Sitemap