C++ was designed to be highly compatible with C. C programmers can learn C++ at their own pace and incorporate features of the new language when it seems appropriate. C++ supplements what is good and useful about C. Most important, C++ retains C's efficient interface to the hardware of the computer, including types and operators that correspond directly to components of computing equipment.
C++ does have some important differences. An ordinary C program might not be accepted by the C++ compiler without some modifications. See the C++ Migration Guide for information about what you must know to move from programming in C to programming in C++.
The differences between C and C++ are most evident in the way you can design interfaces between program modules, but C++ retains all of C's facilities for designing such interfaces. You can, for example, link C++ modules to C modules, so you can use C libraries with C++ programs.
C++ differs from C in a number of other details. In C++:
Typed constants allow you to avoid the preprocessor and use named constants in your program.
Function prototypes are required.
The free store operators new and delete create dynamic objects of a specified type.
References are automatically dereferenced pointers and act like alternate names for a variable. You can use references as function parameters.
Special built-in operator names for type coercion are provided.
Programmer-defined automatic type conversion is allowed.
Variable declarations are allowed anywhere a statement may appear. They may also occur within the header of an if, switch, or loop statement, not just at the beginning of the block.
A new comment marker begins a comment that extends to the end of the line.
The name of an enumeration or class is automatically a type name.
Default values can be assigned to function parameters.
Inline functions can replace a function call with the function body, improving program efficiency without resorting to macros.