Switching from C to C++
Appearance
| Resource type: this resource is a lesson. |
Some believe that learning C++ is easy and suggest learning C before learning C++, while other people disagree and believe that if your intention is to learn C++ that you are better off learning C++ directly rather than trying to learn C first. Switching from C to C++ can be both easy, as there are many similarities between the two languages, and hard, as there are many differences that require forgetting what you know and habits that you may have developed from programming in C.
Differences
- C++ uses new and delete operators for memory management while C uses library functions.
- C++ extends structs and unions, and also includes classes.
- C++ has templates while C does not.
- C++ has operator and function overloading.
- C++ has different requirements for type conversions and alternative type conversion semantics.
- typedef creates unique types in C++, and creates type aliasing in C.