What is the difference between c c++ andc# | Sololearn: Learn to code for FREE!


What is the difference between c c++ andc#

c# c++ c

1/20/2022 7:35:08 AM

Kothai D

7 Answers

New Answer


C is the OG. C++ is an upgrade of C++. C# is Microsoft's attempt of reinventing C, but ends up being similar to Java in terms of syntax and keywords used. Just take this code for example: #include <stdio.h> int main (){ printf("Hello World!"); return 0; } It can run in both C and C++, but not in C#. C# in my opinion is the odd one out for the C family of languages. For flexibility, you can stick to C and C++, since they very similar. C# is just like Java. ㅤㅤㅤ NEZ also left a good comment there.


Okk now I understood...


Great. Good luck with your C learning adventure.


Thank you


Just so you know, they all have differwnt purposes. C does not support classes, sp its not object oriented. C is mainly used in the developmebt if compilers or operating systems. C++ is an object oriented language that allows you to handle memory allocations. C# is object oriented but the memory is auto handled. C# allows reflection so it can be dynamically typed or statically while c++ is just static (unless your a wizard). But performance gets slower and slower with the more and more features. They are all actually very different languages, but syntactically similar


The original C programming language is not object-oriented, which is the most significant difference between the two. C is what’s called a “procedural” programming language, while C++ is a hybrid language that’s a combination of procedural and object-oriented. C++ was built as an extension of C, which means it can run most C code. The reverse isn’t true though—C can’t run C++ code. As an object-oriented language, C++ supports polymorphism, encapsulation, and inheritance, while C does not. In C, data and functions are “free entities,” which means you can manipulate them with outside code. Since C++ encapsulates data and functions together into a single object, those data structures and operators are hidden to outside code. C++ uses the namespace, which organizes code into logical groups and to prevent name collisions. Name collisions can occur when your code base includes multiple libraries. C does not use a namespace. C uses functions for input and output, whereas C++ uses objects for input and output. C++


Why didn't chose Google? https://www.geeksforgeeks.org/difference-between-c-and-c/amp/ https://www.geeksforgeeks.org/difference-between-c-and-c-sharp/amp/ https://www.geeksforgeeks.org/c-vs-c-sharp/amp/