Difference between revisions of "C++"
(23 intermediate revisions by 18 users not shown) | |||
Line 1: | Line 1: | ||
C++ (pronounced "see plus plus") is a general-purpose computer programming language. It is a statically typed free-form multi-paradigm language supporting procedural programming, data abstraction, object-oriented programming, and generic programming | '''C++''' (pronounced "see plus plus") is a general-purpose intermediate-level computer programming language. It is a statically typed free-form multi-paradigm language supporting procedural programming, data abstraction, object-oriented programming, and generic programming. Strictly speaking, C++ is not a superset of [[C]], but for all practical purposes one can consider it thus. | ||
During the 1990s, C++ became one of the most popular commercial programming languages, and it is still widely used today. Recently, however, more modern high-level scripting languages such as [[Python]] and [[Ruby]] are enjoying increasing popularity. | |||
==Differences in C++ from C== | ==Differences in C++ from C== | ||
Line 41: | Line 43: | ||
* {{alpha}} [[Adeo]] | * {{alpha}} [[Adeo]] | ||
* {{7DRL}} [[Backwards Gravity]] | * {{7DRL}} [[Backwards Gravity]] | ||
* {{7DRL}} [[City of the Condemned]] | |||
* {{stable}} [[Cogmind]] | |||
* {{alpha}} [[CyberRogue]] | |||
* {{stable}} [[Decker]] | * {{stable}} [[Decker]] | ||
* {{stable}} [[Deliantra]] | * {{stable}} [[Deliantra]] | ||
Line 46: | Line 51: | ||
* {{beta}} [[Doryen arena]] | * {{beta}} [[Doryen arena]] | ||
* {{alpha}} [[Downfall]] | * {{alpha}} [[Downfall]] | ||
* {{stable}} [[Drakefire Chasm]] | |||
* {{stable}} [[Dragonslayer]] | |||
* {{beta}} [[Dungeon Crawl Stone Soup]] | |||
* {{7DRL}} [[DungeonMinder]] | * {{7DRL}} [[DungeonMinder]] | ||
* {{7DRL}} [[Fatherhood]] | * {{7DRL}} [[Fatherhood]] | ||
Line 52: | Line 60: | ||
* {{alpha}} [[Geminum Orbis]] | * {{alpha}} [[Geminum Orbis]] | ||
* {{stable}} [[Get Out!!]] | * {{stable}} [[Get Out!!]] | ||
* {{stable}} [[Grippy Socks]] | |||
* {{stable}} [[Hunger Games]] | |||
* {{beta}} [[Incursion]] | * {{beta}} [[Incursion]] | ||
* {{beta}} [[Infra Arcana]] | |||
* {{beta}} [[Into the Dungeon ++]] | |||
* {{stable}} [[IVAN]] | * {{stable}} [[IVAN]] | ||
* {{7DRL}} [[Jacob's Matrix]] | * {{7DRL}} [[Jacob's Matrix]] | ||
Line 62: | Line 74: | ||
* {{7DRL}} [[Letter Hunt]] | * {{7DRL}} [[Letter Hunt]] | ||
* {{stable}} [[Linley's Dungeon Crawl]] | * {{stable}} [[Linley's Dungeon Crawl]] | ||
* {{stable}} [[Lost Labyrinth DX]] | |||
* {{7DRL}} [[Magic Monsters]] | * {{7DRL}} [[Magic Monsters]] | ||
* {{alpha}} [[Middlecrest]] | |||
* {{7DRL}} [[Mouse Crawl: Blackheather]] | |||
* {{beta}} [[Nazghul]] | * {{beta}} [[Nazghul]] | ||
* {{alpha}} [[Papaki]] | * {{alpha}} [[Papaki]] | ||
Line 68: | Line 83: | ||
* {{stable}} [[POWDER]] | * {{stable}} [[POWDER]] | ||
* {{beta}} [[PrinceVSZombies]] | * {{beta}} [[PrinceVSZombies]] | ||
* {{stable}} [[Rings of Valor]] | |||
* {{beta}} [[Rogue Effect]] | |||
* {{7DRL}} [[Rogue Mercenaries]] | * {{7DRL}} [[Rogue Mercenaries]] | ||
* {{alpha}} [[Roguelike gcs]] | |||
* {{defunct}} [[QuickQuest]] | * {{defunct}} [[QuickQuest]] | ||
* {{7DRL}} [[Save Scummer]] | * {{7DRL}} [[Save Scummer]] | ||
* {{stable}} [[SCOURGE]] | * {{stable}} [[SCOURGE]] | ||
* {{beta}} [[SewerJacks]] | |||
* {{stable}} [[Shadow of the Wyrm]] | |||
* {{beta}} [[Slaves to Armok II: Dwarf Fortress]] | * {{beta}} [[Slaves to Armok II: Dwarf Fortress]] | ||
* {{beta}} [[The Wastes]] | |||
* {{alpha}} [[Tale of Arcana]] | |||
* {{stable}} [[The Ground Gives Way]] | |||
* {{7DRL}} [[True God]] | * {{7DRL}} [[True God]] | ||
* {{alpha}} [[Underbooks]] | * {{alpha}} [[Underbooks]] | ||
Line 78: | Line 101: | ||
* {{beta}} [[Warlock's Mountain]] | * {{beta}} [[Warlock's Mountain]] | ||
* {{defunct}} [[The Woods of Torbin]] | * {{defunct}} [[The Woods of Torbin]] | ||
* {{alpha}} [[X@COM]] | |||
* {{beta}} [[Xenocide]] | * {{beta}} [[Xenocide]] | ||
* {{7DRL}} [[You Only Live Once]] | * {{7DRL}} [[You Only Live Once]] |
Latest revision as of 09:15, 14 November 2024
C++ (pronounced "see plus plus") is a general-purpose intermediate-level computer programming language. It is a statically typed free-form multi-paradigm language supporting procedural programming, data abstraction, object-oriented programming, and generic programming. Strictly speaking, C++ is not a superset of C, but for all practical purposes one can consider it thus.
During the 1990s, C++ became one of the most popular commercial programming languages, and it is still widely used today. Recently, however, more modern high-level scripting languages such as Python and Ruby are enjoying increasing popularity.
Differences in C++ from C
Features introduced in C++ include declarations as statements, function-like casts, new
/delete
, bool
, reference types, const
, inline
functions, default arguments, function overloading, namespaces, classes (including all class-related features such as inheritance, member functions, virtual functions, abstract classes, and constructors), operator overloading, templates, the ::
operator, exception handling, and run-time type identification.
C++ also performs more type checking than C in several cases.
Comments starting with two slashes ("//") were originally part of C's predecessor, BCPL, and were reintroduced in C++.
Several features of C++ were later adopted by C, including const
, inline
, declarations in for
loops, and C++-style comments (using the //
symbol). However, C99 also introduced
features that do not exist in C++, such as variadic macros and better handling of arrays as parameters.
Design of C++
In The Design and Evolution of C++ ISBN 0-201-54330-3, Bjarne Stroustrup describes some rules that he uses for the design of C++. Knowing the rules helps to understand why C++ is the way it is. The following is a summary of the rules. Much more detail can be found in The Design and Evolution of C++.
- C++ is designed to be a statically typed, general-purpose language that is as efficient and portable as C
- C++ is designed to directly and comprehensively support multiple programming styles (procedural programming, data abstraction, object-oriented programming, and generic programming)
- C++ is designed to give the programmer choice, even if this makes it possible for the programmer to choose incorrectly
- C++ is designed to be as compatible with C as possible, therefore providing a smooth transition from C
- C++ avoids features that are platform specific or not general purpose
- C++ does not incur overhead for features that are not used
- C++ is designed to function without a sophisticated programming environment
Please refer to the indepth book on C++ Internals by Stanley B. Lippman
(he worked on implementing/maintaining C-front the original C++ implementation
at Bell Labs).
"Inside the C++ Object Model" documents how the C++ compiler converts your program statements into an in-memory layout.
Roguelike Specific Details
C++ is a great language to write a rogue-like with. It has all the freedom of C, with some additional language features which can make a programmer's life easier (such as templates and classes).
C++ Roguelikes
- stable 3059
- defunct Abura Tan
- defunct The Abyss of Nah-Karr
- αlpha Adeo
- 7DRL Backwards Gravity
- 7DRL City of the Condemned
- stable Cogmind
- αlpha CyberRogue
- stable Decker
- stable Deliantra
- βeta DemiseRL
- βeta Doryen arena
- αlpha Downfall
- stable Drakefire Chasm
- stable Dragonslayer
- βeta Dungeon Crawl Stone Soup
- 7DRL DungeonMinder
- 7DRL Fatherhood
- 7DRL The Favored
- stable Frozen Depths
- αlpha Geminum Orbis
- stable Get Out!!
- stable Grippy Socks
- stable Hunger Games
- βeta Incursion
- βeta Infra Arcana
- βeta Into the Dungeon ++
- stable IVAN
- 7DRL Jacob's Matrix
- αlpha Kaduria
- βeta Labyrinth of Reptoran
- βeta Lair of the Demon Ape
- defunct The Legend of Saladir
- βeta Letrain
- 7DRL Letter Hunt
- stable Linley's Dungeon Crawl
- stable Lost Labyrinth DX
- 7DRL Magic Monsters
- αlpha Middlecrest
- 7DRL Mouse Crawl: Blackheather
- βeta Nazghul
- αlpha Papaki
- αlpha Peleron's Brilliant Rebirth
- stable POWDER
- βeta PrinceVSZombies
- stable Rings of Valor
- βeta Rogue Effect
- 7DRL Rogue Mercenaries
- αlpha Roguelike gcs
- defunct QuickQuest
- 7DRL Save Scummer
- stable SCOURGE
- βeta SewerJacks
- stable Shadow of the Wyrm
- βeta Slaves to Armok II: Dwarf Fortress
- βeta The Wastes
- αlpha Tale of Arcana
- stable The Ground Gives Way
- 7DRL True God
- αlpha Underbooks
- 7DRL Warlock of Firetop Mountain
- βeta Warlock's Mountain
- defunct The Woods of Torbin
- αlpha X@COM
- βeta Xenocide
- 7DRL You Only Live Once
- αlpha Zaiband