ss_blog_claim=b2c8801cecb8aefe7201c97184ef9ab3 C++ Community of PSMZA: what is C# ?

Tuesday, May 20, 2008

what is C# ?

There has been BCPL, C, and C++; Microsoft recently introduced yet another language in the same naming tradition: C# (pronounced "C sharp"). C# is a language designed to be fully compatible with Microsoft's .NET initiative while taking advantage of what has been learned from C and C++ (as well as Java).

C# is designed to be a platform-independent language in the tradition of Java. It's syntax is similar to C and C++ syntax, and C# is designed to be an object-oriented language. There are, for the most part, minor variations in syntax between C++ and C#. Main has no return type, there are no semicolons after class names, there are some (to C++ programmers) strange decisions regarding capitalization - such as the capitalisation of Main. Other a few differences, the syntax is often the same. This decision is reasonable, in light of the fact that C syntax has been used with several other languages - notably Java.

Similar to Java, C# does not support multiple inheritance; instead it provides Java's solution: interfaces. Interfaces implemented by a class specify certain functions that the class is guaranteed to implement. Interfaces avoid the messy dangers of multiple inheritance while maintaining the ability to let several classes implement the same set of methods.


Another helpful feature of C# is garbage collection. Therefore, it is unnecessary to include a destructor for each class unless a class handles unmanaged resources; if so, it's necessary to release control those resources from within the class (The Finalize function is used to clear up these unmanaged resources; it can even be abbreviated with the same syntax as a C++ destructor). Of course, C# also provides direct access to memory through C++ style pointers, but these pointers are not garbage collected until specificially released by the programmer.

click for more info :: http://www.cprogramming.com/tutorial/csharp.html

No comments: