Switching from C to C++: Difference between revisions
Appearance
wikademia>Gbaor stub |
wikademia>Wikademia m 9 revisions |
(No difference)
| |
Revision as of 18:30, 5 April 2009
| Switching from C to C++ | |
|---|---|
| Prerequire | Some understanding of C and C++ |
| Experience | Intermediate |
| Lesson Description | |
| Differences between C++ and C | |
| What you will learn | |
| |
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.