Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
C++
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|General-purpose programming language}} {{pp-move-vandalism|small=yes}} {{Redirect-multi|2|cxx|.cxx|other uses|CXX (disambiguation){{!}}CXX}} {{Use dmy dates|date=January 2020}} {{Infobox programming language | name = C++ | logo = ISO C++ Logo.svg | logo caption = Logo endorsed by the C++ standards committee | paradigms = [[Multi-paradigm programming language|Multi-paradigm]]: [[procedural programming|procedural]], [[imperative programming|imperative]], [[functional programming|functional]], [[object-oriented programming|object-oriented]], [[generic programming|generic]], [[modular programming|modular]] | family = [[C (programming language)|C]] | designer = [[Bjarne Stroustrup]] | developer = [[ISO/IEC JTC 1/SC 22|ISO/IEC JTC 1 (Joint Technical Committee 1) / SC 22 (Subcommittee 22)]] / WG 21 (Working Group 21) | released = {{Start date and age|df=yes|1985}} | latest release version = [[C++23]] (ISO/IEC 14882:2024) | latest release date = {{Start date and age|2024|10|19|df=yes}} | latest preview version = [[C++26]] | latest preview date = {{Start date and age|2024|10|16|df=yes}} | typing = [[Static type|Static]], [[strong and weak typing|strong]], [[nominal type system|nominative]], [[type inference|partially inferred]] | scope = | platform = | operating system = [[Cross-platform]] | file ext = .C, .cc, .cpp, .cxx, {{nowrap|.c++}}, .h, .H, .hh, .hpp, .hxx, {{nowrap|.h++}} .cppm, .ixx<ref>{{cite web|url=https://learn.microsoft.com/en-us/cpp/cpp/modules-cpp?view=msvc-170|title=Overview of modules in C++|date=24 April 2023 |publisher=Microsoft}}</ref> | file format = | implementations = {{nowraplinks| [[GNU Compiler Collection|GCC]], [[Clang|LLVM Clang]], [[Microsoft Visual C++]], [[C++Builder|Embarcadero C++Builder]], [[Intel C++ Compiler]], [[IBM XL C++]], [[Edison Design Group|EDG]]}} | dialects = | wikibooks = C++ Programming | influenced by = [[Ada (programming language)|Ada]], [[ALGOL 68]],<ref name="history-cpp-paper">{{cite book |last=Stroustrup |first=Bjarne |date=1996 |pages=699β769 |chapter=A history of C++: 1979-1991 |title=History of programming languages---II |publisher=[[Association for Computing Machinery|ACM]] |doi=10.1145/234286.1057836 |doi-access=free }}</ref> [[BCPL]],<ref name="cppcon21_bj">{{cite web |url=https://www.youtube.com/watch?v=15QF2q66NhU |title=C++20: Reaching for the Aims of C++ - Bjarne Stroustrup - CppCon 2021 |first=Bjarne |last=Stroustrup |publisher=CppCon |date=December 16, 2021 |access-date=30 December 2021 |archive-date=30 December 2021 |archive-url=https://web.archive.org/web/20211230092718/https://www.youtube.com/watch?v=15QF2q66NhU |url-status=live }}</ref> [[C (programming language)|C]], [[CLU (programming language)|CLU]],<ref name="history-cpp-paper" /> [[F Sharp (programming language)|F#]],<ref>{{cite journal | last=Stroustrup | first=Bjarne | title=Thriving in a crowded and changing world: C++ 2006β2020 | journal=Proceedings of the ACM on Programming Languages | publisher=Association for Computing Machinery (ACM) | volume=4 | issue=HOPL | date=2020-06-12 | issn=2475-1421 | doi=10.1145/3386320 | pages=1β168| s2cid=219603741 | doi-access=free }}</ref><ref group=note>For the idea of the C++20 stackless coroutines.</ref> [[ML (programming language)|ML]], [[Mesa (programming language)|Mesa]],<ref name="history-cpp-paper" /> [[Modula-2]],<ref name="history-cpp-paper" /> [[Simula]], [[Smalltalk]]<ref name="history-cpp-paper" /> | influenced = [[Ada (programming language)|Ada 95]]<!-- 1995 -->, [[C Sharp (programming language)|C#]]<!-- 2001 -->,<ref name="influenceSharp">{{cite journal |last=Naugler |first=David |date=May 2007 |title=C# 2.0 for C++ and Java programmer: conference workshop |journal=Journal of Computing Sciences in Colleges |volume=22 |issue=5 |quote=Although C# has been strongly influenced by Java it has also been strongly influenced by C++ and is best viewed as a descendant of both C++ and Java.}}</ref> [[C99]]<!-- 1999 -->, [[Carbon (programming language)|Carbon]], [[Chapel (programming language)|Chapel]],<ref name="chplspec">{{cite web|title=Chapel spec (Acknowledgements)|url=https://chapel-lang.org/spec/spec-0.98.pdf|date=1 October 2015|access-date=14 January 2016|publisher=Cray Inc|archive-date=24 June 2018|archive-url=https://web.archive.org/web/20180624150422/https://chapel-lang.org/spec/spec-0.98.pdf|url-status=live}}</ref> [[Clojure]],<ref>{{cite web |url=https://www.codequarterly.com/2011/rich-hickey/ |archive-url=https://web.archive.org/web/20170111184835/http://www.codequarterly.com/2011/rich-hickey/ |url-status=dead |archive-date=2017-01-11 |title=Rich Hickey Q&A |first1=Michael |last1=Fogus |website=Code Quarterly |access-date=2017-01-11}}</ref> [[D (programming language)|D]]<!-- 1999 -->, [[Java (programming language)|Java]]<!-- 1995 -->,<ref>{{cite web |url=https://books.google.com/books?id=0rUtBAAAQBAJ&pg=PA133 |title=Cracking The Java Programming Interview :: 2000+ Java Interview Que/Ans |author=Harry. H. Chaudhary |access-date=29 May 2016 |date=28 July 2014 |archive-date=27 May 2021 |archive-url=https://web.archive.org/web/20210527025512/https://books.google.com/books?id=0rUtBAAAQBAJ&pg=PA133 |url-status=live }}</ref> [[JS++]],<ref>{{cite web|url=https://www.onux.com/jspp/blog/scaling-jspp-abstraction-performance-and-readability/|title=Scaling JS++: Abstraction, Performance, and Readability|author=Roger Poon|date=1 May 2017|access-date=21 April 2020|archive-date=11 May 2020|archive-url=https://web.archive.org/web/20200511095442/https://www.onux.com/jspp/blog/scaling-jspp-abstraction-performance-and-readability/|url-status=live}}</ref> [[Lua (programming language)|Lua]]<!-- 1993 -->,<ref>{{Cite web|url=https://www.lua.org/history.html|title=The evolution of an extension language: a history of Lua|website=www.lua.org|access-date=2023-01-04}}</ref> [[Nim (programming language)|Nim]],<ref>{{cite web|url=https://nim-lang.org/faq.html|title=FAQ Nim Programming Language|access-date=2020-04-21|archive-date=11 July 2017|archive-url=https://web.archive.org/web/20170711004631/https://nim-lang.org/faq.html|url-status=live}}</ref> [[Objective-C++]], [[Perl]]<!-- 1987 -->, [[PHP]]<!-- 1995 -->, [[Python (programming language)|Python]],<ref>{{Cite web|url=https://docs.python.org/tutorial/classes.html|title=9. Classes β Python 3.6.4 documentation|website=docs.python.org|access-date=2018-01-09|archive-date=23 October 2012|archive-url=https://web.archive.org/web/20121023030209/http://docs.python.org/tutorial/classes.html|url-status=live}}</ref> [[Rust (programming language)|Rust]],<ref>{{Cite web|url=https://doc.rust-lang.org/reference/influences.html|title=Influences - The Rust Reference|website=doc.rust-lang.org|access-date=2023-01-04}}</ref> [[Seed7]] }} '''C++''' ({{IPAc-en|'|s|i:|_|p|l|V|s|_|p|l|V|s}}, pronounced "'''C plus plus'''" and sometimes abbreviated as '''CPP''' or '''CXX''') is a [[high-level programming language|high-level]], [[general-purpose programming language]] created by Danish computer scientist [[Bjarne Stroustrup]]. First released in 1985 as an extension of the [[C (programming language)|C programming language]], adding [[object-oriented programming|object-oriented]] (OOP) features, it has since expanded significantly over time adding more OOP and other features; {{as of|1997|lc=true}}/C++98 standardization, C++ has added [[functional programming|functional]] features, in addition to facilities for [[low-level programming language|low-level]] [[memory (computing)|memory]] manipulation for systems like [[microcomputer]]s or to make operating systems like [[Linux]] or [[Microsoft Windows|Windows]], and even later came features like [[generic programming|generic]] ([[template (C++)|template) programming]]. C++ is usually implemented as a [[compiled language]], and many vendors provide [[List of compilers#C.2B.2B compilers|C++ compilers]], including the [[Free Software Foundation]], [[LLVM]], [[Microsoft]], [[Intel]], [[Embarcadero Technologies|Embarcadero]], [[Oracle Developer Studio|Oracle]], and [[IBM]].<ref name="stroustruptcpppl">{{Cite book |last=Stroustrup |first=Bjarne |author-link=Bjarne Stroustrup |title=The C++ Programming Language |year=1997 |edition=Third |chapter=1 |publisher=Addison-Wesley |isbn=0-201-88954-4 |oclc=59193992 |url=https://archive.org/details/cprogramminglang00stro_0 }}</ref> C++ was designed with [[systems programming]] and [[embedded software|embedded]], resource-constrained software and large systems in mind, with [[performance (software)|performance]], efficiency, and flexibility of use as its design highlights.<ref name=Stroustrup1>{{cite web|url=https://www.youtube.com/watch?v=86xWVb4XIyE|author=Stroustrup, B.|title=Lecture:The essence of C++. University of Edinburgh.|website=[[YouTube]]|date=6 May 2014|access-date=12 June 2015|archive-date=28 April 2015|archive-url=https://web.archive.org/web/20150428003608/https://www.youtube.com/watch?v=86xWVb4XIyE|url-status=live}}</ref> C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications,<ref name=Stroustrup1 /> including [[application software|desktop applications]], [[video game development|video games]], [[server (computing)|servers]] (e.g., [[e-commerce]], [[Web search engine|web search]], or [[database]]s), and performance-critical applications (e.g., [[telephone exchange|telephone switches]] or [[space probes]]).<ref name="applications">{{cite web |url=http://www.stroustrup.com/applications.html |title=C++ Applications |date=17 February 2014 |access-date=5 May 2014 |first=Bjarne |last=Stroustrup |website=stroustrup.com |archive-date=4 April 2021 |archive-url=https://web.archive.org/web/20210404065717/https://www.stroustrup.com/applications.html |url-status=live }}</ref> C++ is standardized by the [[International Organization for Standardization]] (ISO), with the latest standard version ratified and published by ISO in October 2024 as ''ISO/IEC 14882:2024'' (informally known as [[C++23]]).<ref name="isocpp2024"/> The C++ programming language was initially standardized in 1998 as ''ISO/IEC 14882:1998'', which was then amended by the [[C++03]], [[C++11]], [[C++14]], [[C++17]], and [[C++20]] standards. The current {{nowrap|[[C++23]]}} standard supersedes these with new features and an enlarged [[C++ Standard library|standard library]]. Before the initial standardization in 1998, C++ was developed by Stroustrup at [[Bell Labs]] since 1979 as an extension of the C language; he wanted an efficient and flexible language similar to C that also provided [[high-level programming language|high-level features]] for program organization.<ref>{{cite web |title=Bjarne Stroustrup's Homepage |url=http://www.stroustrup.com |website=www.stroustrup.com |access-date=15 May 2013 |archive-date=14 May 2019 |archive-url=https://web.archive.org/web/20190514123147/http://www.stroustrup.com/ |url-status=live }}</ref> Since 2012, C++ has been on a three-year release schedule<ref>{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1000r4.pdf|title=C++ IS schedule|access-date=9 August 2020|archive-date=10 August 2020|archive-url=https://web.archive.org/web/20200810105609/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1000r4.pdf|url-status=live}}</ref> with [[C++26]] as the next planned standard.<ref>{{cite web |title = C++; Where it's heading |url = https://dzone.com/articles/c-where-is-it-heading-and-what-are-the-new-feature |access-date = 3 December 2018 |archive-date = 3 December 2018 |archive-url = https://web.archive.org/web/20181203104022/https://dzone.com/articles/c-where-is-it-heading-and-what-are-the-new-feature |url-status = live }}</ref> Despite its widespread adoption, some notable programmers have [[criticism of C++|criticized the C++ language]], including [[Linus Torvalds]],<ref name="torvalds">{{cite mailing list |title=Re: [RFC] Convert builin-mailinfo.c to use The Better String Library |date=6 September 2007 |url=https://lwn.net/Articles/249460/ |access-date=31 March 2015 |archive-url=https://web.archive.org/web/20210308222938/https://lwn.net/Articles/249460/ |archive-date=8 March 2021 |url-status=live}}</ref> [[Richard Stallman]],<ref>{{cite mailing list |title=Re: Efforts to attract more users? |date=12 July 2010 |url=http://harmful.cat-v.org/software/c++/rms |access-date=31 March 2015 |archive-url=https://web.archive.org/web/20150321233514/http://harmful.cat-v.org/software/c%20%20/rms |archive-date=21 March 2015 |url-status=live}}</ref> [[Joshua Bloch]], [[Ken Thompson]],<ref>{{cite web |author=Andrew Binstock |date=18 May 2011 |title=Dr. Dobb's: Interview with Ken Thompson |work=Dr. Dobb's |url=https://www.drdobbs.com/open-source/interview-with-ken-thompson/229502480 |url-status=live |archive-url=https://web.archive.org/web/20140313072938/http://www.drdobbs.com/open-source/interview-with-ken-thompson/229502480 |archive-date=13 March 2014 |access-date=7 February 2014}}</ref><ref name="Seibel2009">{{cite book |author=Peter Seibel |url=https://books.google.com/books?id=nneBa6-mWfgC&pg=PA475 |title=Coders at Work: Reflections on the Craft of Programming |date=16 September 2009 |publisher=Apress |isbn=978-1-4302-1948-4 |pages=475β476 |access-date=9 November 2017 |archive-url=https://web.archive.org/web/20191201142309/https://books.google.com/books?id=nneBa6-mWfgC&pg=PA475 |archive-date=1 December 2019 |url-status=live}}</ref><ref name="gigamonkeysWordpress">{{Cite web |date=16 October 2009 |title=C++ in Coders at Work |url=https://gigamonkeys.wordpress.com/2009/10/16/coders-c-plus-plus/ |url-status=live |archive-url=https://web.archive.org/web/20171110061643/https://gigamonkeys.wordpress.com/2009/10/16/coders-c-plus-plus/ |archive-date=10 November 2017 |access-date=9 November 2017}}</ref> and [[Donald Knuth]].<ref name="dobbsKnuth">{{Cite web |title=An Interview with Donald Knuth |url=https://drdobbs.com/an-interview-with-donald-knuth/184409858 |url-status=live |archive-url=https://web.archive.org/web/20210308031011/https://www.drdobbs.com/architecture-and-design/an-interview-with-donald-knuth/228700500 |archive-date=8 March 2021 |access-date=18 July 2021 |website=Dr. Dobb's}}</ref><ref name="knuth1993">{{Cite web |title=(La)TeX Navigator |url=http://tex.loria.fr/litte/knuth-interview |url-status=live |archive-url=https://web.archive.org/web/20171120163257/http://tex.loria.fr/litte/knuth-interview |archive-date=20 November 2017 |access-date=10 November 2017}}</ref> This is largely due to its manual memory management, which makes it vulnerable to [[buffer overflow]] bugs, which represent a security risk.<ref>{{Cite news |last=Claburn |first=Thomas |date=2 March 2025 |title=C++ creator calls for help to defend programming language from 'serious attacks' |url=https://www.theregister.com/2025/03/02/c_creator_calls_for_action/ |access-date=5 March 2025 |work=The Register}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)