+ 4

What is the difference in C# and C++ programming?

6th Dec 2016, 4:05 PM
Pankaj Pandey
Pankaj Pandey - avatar
2 Risposte
+ 2
C and C++ are very similar, relative to C#, and the largest differences between the two are in C++'s Object orientedness and generics. Generally speaking, C++ is a much more modern language, such as in C++11 also supports things like lambda (anonymous functions) and type inference with the "auto" keyword (although it is still statically typed.  C# is very different, because, unlike in C++ where you can define functions outside of classes, everything in C# is part of some class. It also supports generic and type inference with "var". Additionally, C# has a garbage collector and you cannot manually manage pointers and such (unless you turn it on). Instead, classes are automatically pointers, and structure are not, so if you assign x to y, if they are both a certain class, and change y, it will also change x. Syntax wise (curly brackets, keywords) all three are fairly similar. All use, int, bool, void, float, and chat, for example, as well as for and while, if, else if, and else.
6th Dec 2016, 4:15 PM
Vipul Walia
Vipul Walia - avatar
0
C++ runs without dot net framework it is directly compiled to machine code c# runs only on dot net framework it is developed by microsoft and inspired from java. Just as java uses bytecode and java virtual machine
10th Dec 2016, 6:12 PM
Shiv Singh Sisodiya
Shiv Singh Sisodiya - avatar