Table of Contents
- Special Member Functions: Constructors, Destructors, and the Assignment Operator
- Operator Overloading
- Memory Management
- Time and Date Library
- Object-Oriented Programming and Design Principles
- The Standard Template Library (STL) and Generic Programming
- Exception Handling
- Runtime Type Information (RTTI)
- Signal Processing
- Creating Persistent Objects
- Bit Fields
- New Cast Operators
- Environment Variables
- Variadic Functions
- Pointers to Functions
- Function Objects
- Pointers to Members
- Lock Files
- Design Patterns
- Dynamic Linking
- Tips and Techniques
- Five Things You Need to Know About C++11 Unions
- A Tour of C99
- A Tour of C1X
- C++0X: The New Face of Standard C++
- C++0x Concurrency
- The Reflecting Circle
- We Have Mail
- The Soapbox
- Numeric Types and Arithmetic
- Locales and Internationalization
What Is C++?
Last updated Jan 1, 2003.
C++ is a general-purpose, platform-neutral compiled programming language that supports various programming paradigms, including procedural programming, object-based programming, object-oriented programming, generic programming and functional programming. Unlike several other programming languages, C++ doesn’t impose a specific programming paradigm on its users. This liberality has two major advantages: it enables reuse of C code with minimal or no modifications at all, and it enables designers to choose the paradigm that suits their needs best.
A Bit of History
As opposed to most commercial programming languages that are designed from scratch, C++ was designed as an extension, or superset, of C. Bjarne Stroustrup started to design C++ in 1979 at Bell Laboratories. At that time, the language didn’t have a special name; it was called "C with classes". C with classes supported object-oriented programming facilities including classes, polymorphism, inheritance and operator overloading (these are discussed in the next sections). In 1983 (and according to other versions, in 1984) the name "C++" was proposed and accepted. The first commercial implementation of C++, cfront 1.0, was released in 1985. Cfront was a C++ to C translator. The intermediary C code would then be compiled to native machine code.
The C++ Standardization
Designing C++ as a superset of C offers several advantages:
Reuse of C code in C++ applications
Relatively quick migration from C to C++
Avoiding mistakes that occur with languages that are designed from scratch
However, the dependency on C as the substratum of C++ also incurs certain complexities such as the lack of an automatic garbage collection, widespread use of pointers, unchecked array bounds, the lack of a native string type and cryptic declarator syntax.
C++ is a vendor- and platform-neutral language. It’s defined and maintained by an ISO committee that consists of the delegates from national standardization bodies such as ANSI, BSI Group, DIN and many others. The first C++ international standard was ratified in 1998. It has since undergone two major revisions. The first revision is dubbed "C++03". C++03 includes new libraries for smart pointers, regular expressions, tuples and hashed containers, as well as some bug fixes. The second revision of the C++ standard is taking place in these very days. The intent is to finalize the new standard by the end of 2008, hence the name C++09 (or C++0x).
The ISO C++ standard defines the core language, its standard libraries, and implementation requirements. Standard C++ is often used as common denominator among vendors and platforms. Typically, each vendor extends standard C++ by adding platform-specific extensions (e.g., compiler-specific keywords, code libraries and runtime support for dynamic linking, type-checking and proprietary frameworks). However, it’s possible to develop large-scale applications using pure standard C++ thereby ensuring portability and simplifying future maintenance.