Skip to content

Differences Between C, C++ and C#

computers c cpp csharp

There is one thing in common with the languages C, C++ and C#: their first letter. The fact of their name be similar makes some people think that these languages are almost the same thing. But… is it true? Are there any more similarities between these languages beyond their name?

Language C

The programming language C was created at Bell Labs by a computer scientist whose name is Dennis Ritchie. This was back in 1969. The language C was based on another language called B. C can be considered the most popular programming language ever made. On of the biggest reasons for that is that programs written in C can run on a lot of operating systems (from Macs to Windows, for example).

Bell Laboratories in Murray Hill, New Jersey
Bell Laboratories in Murray Hill, New Jersey

Nowadays, C is a language mainly used to programs that need to run quickly and smoothly without using much memory. C is a low level language, which means that it has small abstraction layer compared to other language such as Java or C#; it also means that C can have a more direct contact with the hardware.

Making a little characterization of this language: C is a general-purpose and imperative programming language. It supports structured programming, lexical variable and recursion.

Language C++

Back in 1979, C++ was developed by a Danish programmer named Bjarne Stroustrup. His main goal was to develop a class system for C. That’s why C++ was initially called “C with Classes”; it was only renamed in 1983. C++ added a lot of new features to C, designed to make programming more efficient and give the developer more options on how they would like to code.

Bjarne Stroustrup, the creator of C++
Bjarne Stroustrup, the creator of C++

The main difference between C and C++ is the fact that C++ supports classes (and objects) and has a huge library of useful functions called STD (Standard Template Library).

C++ is also a general-purpose language; it’s imperative, object-oriented and has generic programming features and also provides facilities for low-level memory manipulation.

Language C#

In 2001, Microsoft published a new language: C#, intended to be a new object-oriented language. This language is not based on C, but a C-like language. Originally, the code-name of this language was “Cool”, but Microsoft ended up calling it C#; apparently, Microsoft was on a roll with adding # to letters (A#, F#…).

C# can be used for pretty much anything. But, as it was produced by Microsoft, it ended up powering a lot of Windows programs too. So, C# is mainly used with Windows in mind. But it is not an obligation.

Characterization: C# is a multi-paradigm programming language; it follows the imperative, declarative, functional and object-oriented paradigms. It’s also strongly typed and component-oriented programming language.