What’s the difference between C# and C++ in the code itself?

4.72K views

I know that C# is oop, and C++ isn’t, and I know that garbage collection is easier in C#, but what are the actual differences in how lines are written, and why pick one over the other?

EDIT: to clarify, I have c# experience, and I’m considering picking up C++, but whenever I google it, it gives me only the obvious surface level differences

In: Other

2 Answers

Anonymous 0 Comments

> I know that C# is oop, and C++ isn’t

What? Both are OOP.

> I know that garbage collection is easier in C#

That’s because there is no garbage collector in C++, you need to dispose of stuff manually.

> but what are the actual differences in how lines are written

They are different languages. It’s like asking what’s the difference between how lines are written in Java and C#. There are many similarities between the syntax of C# and C++ though. C++ has pointer and references. Things you don’t need to worry about in C#.

> and why pick one over the other?

Depends on what you are doing. There are certain frameworks that work with C++ but not C#. For example the QT GUI framework. On the other hand, the Unity game engine works with C# and Javascript and not C++.

I think it’s safe to say that C++ is more performant but whether or not you really need this performance advantage depends on what you are doing.

You are viewing 1 out of 2 answers, click here to view all answers.