Difference between revisions of "CPP"

From ProgrammingExamples
Jump to: navigation, search
(General Examples)
 
(38 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
A statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as a "middle-level" language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C programming language and originally named C with Classes. It was renamed C++ in 1983. (http://en.wikipedia.org/wiki/C++)
 
A statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as a "middle-level" language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C programming language and originally named C with Classes. It was renamed C++ in 1983. (http://en.wikipedia.org/wiki/C++)
 
----
 
----
 +
=== Formatting ===
 +
* [[CPP/Formatting/Decimals|Number of decimals (fixed and setprecision)]]
 +
 
=== General Examples ===
 
=== General Examples ===
 +
* [[CPP/decltype|Get the type of a variable or function]]
 +
* [[CPP/bind|Bind different sets of arguments to a function]]
 +
* [[CPP/Pragma|Compile time output (pragma message)]]
 +
* [[CPP/CustomIterator|A custom iterator]]
 +
* [[CPP/StaticConstInitialization|Static const initialization]]
 +
* [[CPP/StaticInheritance|Static inheritance]]
 +
* [[CPP/StaticFunction|Static function]]
 +
* [[CPP/recursion|Recursion - a recursive function]]
 +
* [[CPP/unique_ptr|unique_ptr]]
 +
* [[CPP/Functor|Functor]]
 +
* [[CPP/ReturnByReference|Return a value by reference]]
 
* [[CPP/IntToHex|Convert an int to hex]]
 
* [[CPP/IntToHex|Convert an int to hex]]
 +
* [[CPP/HexToInt|Convert a hex number to an int]]
 
* [[CPP/AnonymousNamespace|Anonymous namespace]]
 
* [[CPP/AnonymousNamespace|Anonymous namespace]]
 
* [[CPP/2DVector|2D Vector]]
 
* [[CPP/2DVector|2D Vector]]
Line 45: Line 60:
 
* [[CPP/Strings/FindAndReplace|Replace a substring with a replacement string (find and replace)]]
 
* [[CPP/Strings/FindAndReplace|Replace a substring with a replacement string (find and replace)]]
 
* [[CPP/Strings/Find|Find the position of a substring]]
 
* [[CPP/Strings/Find|Find the position of a substring]]
 +
* [[CPP/Strings/DetectPunctuation|Detect punctuation (ispunct)]]
  
 
=== Classes ===
 
=== Classes ===
* [[CPP/Classes/ClassTemplate|Class template]]
 
 
* [[CPP/Classes/ConstructorInheritance|Constructor inheritance]]
 
* [[CPP/Classes/ConstructorInheritance|Constructor inheritance]]
 
* [[CPP/Classes/InitializationList|Initialization list]]
 
* [[CPP/Classes/InitializationList|Initialization list]]
Line 59: Line 74:
  
 
=== Templates ===
 
=== Templates ===
* [[CPP/FunctionTemplate|Function template]]
+
* [[CPP/Templates/FunctionTemplateHeaderOnly|Function template (header only)]]
 +
* [[CPP/Templates/FunctionTemplateExplicitInstantiation|Function template (explicit instantiation)]]
 
* [[CPP/FunctionTemplateSpecialization|Function template specialization]]
 
* [[CPP/FunctionTemplateSpecialization|Function template specialization]]
 +
* [[CPP/Templates/ClassTemplateHeaderOnly|Class template (header only)]]
 +
* [[CPP/Templates/ClassTemplateExplicitInstantiation|Class template (explicit instantiation)]]
 +
* [[CPP/Templates/MemberFunctionTemplate|A member function template]]
 +
* [[CPP/Templates/PartialClassSpecialization|Partially specialize a class template]]
  
 
=== Loops ===
 
=== Loops ===
Line 77: Line 97:
 
*[[CPP/STL/PriorityQueue|Priority queue]]
 
*[[CPP/STL/PriorityQueue|Priority queue]]
 
*[[CPP/STL/Queue|Queue]]
 
*[[CPP/STL/Queue|Queue]]
*[[CPP/STL/Set|Set]]
 
 
*[[CPP/STL/Stack|Stack]]
 
*[[CPP/STL/Stack|Stack]]
 
*[[CPP/STL/String|String]]
 
*[[CPP/STL/String|String]]
 
*[[CPP/STL/Tuple|Tuple]]
 
*[[CPP/STL/Tuple|Tuple]]
 +
*[[CPP/STL/IteratorFromObject|Iterator from object]]
 +
 +
==== Vector ====
 
*[[CPP/STL/Vector|Vector]]
 
*[[CPP/STL/Vector|Vector]]
 +
*[[CPP/STL/Vector/RemoveElement|Remove an element from a vector]] delete, erase
 +
*[[CPP/STL/Vector/Reverse|Reverse the elements in a vector]]
 +
 +
==== Set ====
 +
*[[CPP/STL/Set|Set]]
 +
*[[CPP/STL/Set/RemoveElement|Remove an element from a set]]
 +
*[[CPP/STL/Set/MergeSets|Merge sets]]
 +
*[[CPP/STL/Set/SearchForElement|Search for an element (find)]]
 +
*[[CPP/STL/Set/SetCustomClass|Custom class]]
 +
*[[CPP/STL/Set/SetCustomComparison|Custom comparison operator]]
 +
*[[CPP/STL/Set/BoundedInsert|A custom function to insert an element into the set only if it is less than an element currently in the set, and keep the same size]]
  
 
=== STL Algorithms ===
 
=== STL Algorithms ===
Line 89: Line 122:
 
* [[CPP/STL/RandomData|Random data (std::generate)]]
 
* [[CPP/STL/RandomData|Random data (std::generate)]]
 
* [[CPP/STL/ForEach|ForEach]]
 
* [[CPP/STL/ForEach|ForEach]]
 +
* [[CPP/STL/VectorMinAndMax|VectorMinAndMax]]
  
 
=== Debugging ===
 
=== Debugging ===
Line 98: Line 132:
  
 
=== C++0x ===
 
=== C++0x ===
 +
*[[CPP/C++0x/TheBigFive|The Big Five]]
 +
*[[CPP/C++0x/VectorInitialization|Vector initialization]]
 +
*[[CPP/C++0x/VectorMinMax|VectorMinMax]]
 
*[[CPP/C++0x/Hash|Hash]]
 
*[[CPP/C++0x/Hash|Hash]]
 +
*[[CPP/C++0x/UnorderedSet|Unordered set]]
 +
*[[CPP/C++0x/Lambda|Lambda]]
  
 
=== Math ===
 
=== Math ===
Line 104: Line 143:
 
*[[CPP/Math/MinMax|Min and Max]]
 
*[[CPP/Math/MinMax|Min and Max]]
 
*[[CPP/Math/Trig|Trig functions]]
 
*[[CPP/Math/Trig|Trig functions]]
*[[CPP/Math/SumVector|Sum elements in a vector]]
+
*[[CPP/Math/SumVector|Sum elements in a vector (accumulate)]]
 +
*[[CPP/Math/Pi|Mathematic constant Pi = 3.14...]]
 +
*[[CPP/Math/Median|Median of a vector]]
  
 
=== C-Style Programming Techniques ===
 
=== C-Style Programming Techniques ===

Latest revision as of 08:58, 20 November 2016

C++

A statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as a "middle-level" language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C programming language and originally named C with Classes. It was renamed C++ in 1983. (http://en.wikipedia.org/wiki/C++)


Formatting

General Examples

I/O

Strings

Classes

Templates

Loops

STL Data Structures

Vector

Set

STL Algorithms

Debugging

C++ TR1

C++0x

Math

C-Style Programming Techniques

Utility