What is C++?
C++ is a statically-typed, free-form, (usually) compiled, multi-paradigm, intermediate-level general-purpose programming language; not to be confused with C. It was developed in the early 1980s by Bjarne Stroustrup as a set of extensions to the C programming language. Building on C, C++ improved type-safety and added support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.
New to C++?
Whether you are new to programming or coming to C++ from another programming language, it is highly recommended to have a good book from which to learn the language — we keep a detailed list of books.
If you are looking for good compilers, g++ is the most commonly used compiler on Linux and other Unix-like platforms; clang is the official compiler on Mac and FreeBSD; Microsoft Visual C++ is the most commonly used on Windows. The Intel compiler is also commonly used for its optimized numerical computations on Windows, Linux and Mac.
The language standard remained pretty much the same for a long time, but the new standard C++11 (formerly known as C++0x) has now been published as ISO/IEC 14882:2011. Rather than in a "big bang" approach, it is being rolled out gradually as compilers are supporting the new language features. See Bjarne Stroustrup's C++11 FAQ to see what is new in the language, and check your own compiler's FAQ to see which of those features are currently supported:
- GCC language support and libstdc++ library support
- clang language support and libc++ library support
- MSVC language and library support
- Intel language support
A few features that had been under discussion for C++11 have been deferred to the next iteration.
C++14 is a small extension to C++11. It was approved in August 2014, and is currently waiting official publication pending editorial changes. Previously referred to as C++1y as the year of approval was uncertain. Many popular compilers already have some level of C++14 support.
- GCC C++1y language support
- clang C++1y language support
- Intel C++1y language support
- MSVC C++1y language support
The next version of C++ is expected to have more major features. It can be referred to as C++1z, and is intended to be completed in 2017.
If you want to give C++ a spin, you can try one of the following online compiler services:
- Coliru (GCC, Clang)
- ideone.com (GCC)
- codepad (GCC)
- rextester (GCC, Clang, Visual C++)
- ELLCC (Clang)
- CodingGround (GCC)
Have a Question?
When you ask a question, be sure to include any relevant source code. Try to keep the code as minimal as possible while still being able to reproduce the problem; often the problem will be found during the process of creating that sample code. Try to make sure that the source code compiles, if possible. However, if there are any compiler errors, be sure to indicate:
- which compiler you are using, including its version;
- exactly what the errors are (the exact error message(s)); and
- on which lines they occur (mark those lines with comments)
Stack Overflow's C++ FAQ
- Where do I find the current C or C++ standard documents?
- ISOCPP unified modern C++ FAQ
- C++ FAQ: formerly C++ FAQ Lite
- C++ Templates FAQ
- Bjarne Stroustrup's C++ Style and Technique FAQ
- Bjarne Stroustrup's C++11 FAQ
Other External Resources
- ISO C++ website
- C++ Reference
- ISO's C++ Standards Committee's Papers
- Guru of the Week: article series on high-quality, exception-safe C++ code
- Revised Guru of the Week (for C++1y)
- SGI's Standard Template Library Programmer's Guide
- More C++ Idioms
- Boost C++ Libraries (Stack Overflow boost tag)