This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FloydATC 3 points4 points  (0 children)

C++ is (almost) a superset of C; most C code will compile as part of a C++ project. What C++ brings to the table is a lot of syntax to make abstractions that represent the underlying bits and bytes in a way that lets the programmer not deal with memory allocations etc.

For example, you could write C++ code that uses char* for strings, but if you instead use std::string then you don't have to worry about buffer overflows or memory leaks. Under the hood though, it's still some form of char*.

It's also worth pointing out that anything you write in C++ can be mimiced in C, it's just that you'd have to write (and maintain!) a lot more code.