system
Given the following post, respond as if you're commenting on Reddit:
human
How different is C++ to C?

Hi, I'm a Maths and Physics student in the UK and I just got offered a summer job at CERN.

&#x200B;

My project at CERN will require me to use their ROOT software which is mainly written in C++ with some Python and R mixed in. So anybody with experience with ROOT itself would be very helpful but I think general C/C++ knowledge will be helpful too.

&#x200B;

So my question is: If I have experience using C and Python to solve computational physics problems (mainly differential equations and multiple particle systems and whatnot) with a few more general compsci problems like string/array manipulation etc. how quickly can I pick up C++ (ROOT)?

&#x200B;

When learning C and Python I did pick them up fairly quickly (I got a First in the three modules I took) despite having no programming knowledge before uni. I also have some experience using Wolfram Mathematica if that's at all relevant. 

&#x200B;

Thanks for any help :)
gpt
The syntax is superficially similar, and in many cases, C code is also valid C++. But there are a lot of smaller details, where behaviors that are standard in C have different, or even unspecified, behaviors according to the C++ standard (but *might* have specified C-like behavior in some specific compilers).

And it's hard to overemphasize the importance of the memory management features that C++ adds, along with all the standard data structures and algorithms that are part of the language. For example, smart pointers let you tie dynamically allocated memory to scope within the program, so that the memory is automatically deallocated when the pointer goes out of scope (instead of being leaked, like it might accidentally be in C).

And depending on the style of code, there may be heavy use of templates, exceptions, and object-oriented code built into complex hierarchies of classes.

C++ is overall a much larger, more complex language than C, for better or worse. How much C will help you partially depends on the style of the software you'd be working with.