Microsoft Interview Question
Software Engineer in Tests*
CATEGORIES
* Computer programming
* C programming
* Hardware
* Java programming
* UNIX shell scripting
* Web application programming
* Windows Monad msh
* Apple Mac
* Database
* Entertainment
* Green computing
* Internet
* Networking
* Technology reviews
* UNIX
* Windows
C++: Differences between C++ and C#
Contributor Icon Contributed by William_Wilson Date Icon February 27, 2006
ShareThis Tag Icon Tagged: Computer programming
Key differences between C# and C++
It was a surprise that there was no thread for C++ recipes. Though C++ and C# are quite similar there are some very key and major differences.
-I find C# resembles the style of java more than that of C++ i many ways.
(I will be following this up with some coding recipes, to hopefully start a C++ reciped thread)
Method/Function Declarations:
C++:
public:
Constructor() { }
void aMemberFunction() { }
void aFunctionDeclaration();
private:
void someOtherFunction() { }
int aVariable;
C#:
private aVariable;
public void aMemberFunction() { }
public void aFunctionDeclaration();
private void someOtherFunction() { }
Class Declaration:
For those who know what a managed class is:
C++:
__gc class A_Class{ };
*NOTE that C++ classes end with a ;
C#:
automatically done so:
class A_Class{ }
Inheritence:
C++:
will allow multiple inheritence. eg. allows a method to be overriden many times in subclasses (derived classes).
C#:
supports inheritence, but not multiple, only 1 override per method/function/
C++ is regarded as a mid-level language. This indicates that C++ comprises a combination of both high-level and low-level language features. C# is designed specifically to work with the .Net and is geared to the modern environment of Windows and mouse-controlled user interface, networks and the internet.
- yuan April 01, 2010