User contributions
From ProgrammingExamples
(newest | oldest) View (newer 100 | older 100) (20 | 50 | 100 | 250 | 500)
- 09:01, 23 June 2010 (diff | hist) . . (+67) . . Main Page (→STL Data Structures)
- 08:56, 23 June 2010 (diff | hist) . . (+410) . . N CPP/Classes/PureVirtualFunction (Created page with '==PureVirtualFunction.cpp== <source lang="cpp"> #include <iostream> #include <limits> class Point { public: Point(const double xin, const double yin, const double zin) : x(xi…')
- 08:56, 23 June 2010 (diff | hist) . . (+60) . . Main Page (→Classes)
- 08:53, 23 June 2010 (diff | hist) . . (+889) . . N CPP/ParallelSort (Created page with '==ParallelSort.cpp== <source lang="cpp"> #include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; void StructMethod(); struct NumberNa…')
- 08:53, 23 June 2010 (diff | hist) . . (+37) . . Main Page (→C++)
- 08:52, 23 June 2010 (diff | hist) . . (+248) . . N CPP/STL/Pair (Created page with '==Pair.cpp== <source lang="cpp"> #include <iostream> #include <vector> #include <algorithm> int main (int argc, char *argv[]) { std::pair<double, int> a(3.4, 7); std::cout …') (current)
- 08:52, 23 June 2010 (diff | hist) . . (+23) . . Main Page (→STL Data Structures)
- 08:51, 23 June 2010 (diff | hist) . . (+1,704) . . N CPP/OverloadOperator (Created page with '==OverloadOperator.cpp== <source lang="cpp"> #include <iostream> class Point { private: double a; public: double x,y,z; Point(const double xin, const double yin, con…') (current)
- 08:51, 23 June 2010 (diff | hist) . . (+45) . . Main Page (→C++)
- 08:48, 23 June 2010 (diff | hist) . . (+344) . . N CPP/Classes/NestedClasses (Created page with '==NestedClasses.cpp== <source lang="cpp"> #include <iostream> class Parent { int name; class Child { int school; void test() { //std::cout << this->name;…') (current)
- 08:48, 23 June 2010 (diff | hist) . . (+47) . . Main Page (→Classes)
- 08:47, 23 June 2010 (diff | hist) . . (+449) . . N CPP/NAN (Created page with '==NAN.cpp== <source lang="cpp"> #include <iostream> #include <limits> using namespace std; bool IsNaN(const double a); int main(int argc, char *argv[]) { double a = nume…')
- 08:47, 23 June 2010 (diff | hist) . . (+33) . . Main Page (→C++)
- 08:46, 23 June 2010 (diff | hist) . . (+348) . . N CPP/Namespaces (Created page with '==Namespaces.cpp== <source lang="cpp"> #include <iostream> namespace Namespaces { double add(const double a, const double b) { return a + b; } } int main(int argc, c…')
- 08:44, 23 June 2010 (diff | hist) . . (+32) . . Main Page (→C++)
- 08:42, 23 June 2010 (diff | hist) . . (+666) . . N CPP/Math/MinMax (Created page with '==MinMax.cpp== <source lang="cpp"> #include <iostream> #include <cmath> int main(int argc, char *argv[]) { { double a = 10.3; double b = 5.8; std::cout << "Min: " << s…') (current)
- 08:42, 23 June 2010 (diff | hist) . . (+33) . . Main Page (→Math)
- 08:41, 23 June 2010 (diff | hist) . . (+249) . . N CPP/Math/Trig (Created page with '==Trig.cpp== <source lang="cpp"> #include <cmath> #include <iostream> int main() { double x1 = 0; double y1 = 0; double x2 = 100; double y2 = 100; std::cout << 180.…')
- 08:40, 23 June 2010 (diff | hist) . . (+170) . . N CPP/Math/Exponential (Created page with '==Exponential.cpp== <source lang="cpp"> #include <cmath> #include <iostream> int main() { std::cout << exp(4) << std::endl; //should be 54.598 return 0; } </source>') (current)
- 08:38, 23 June 2010 (diff | hist) . . (+95) . . Main Page (→C++0x)
- 08:36, 23 June 2010 (diff | hist) . . (+200) . . N CPP/Macros (Created page with '==Macros.cpp== <source lang="cpp"> #define SetMacro(name,type) \ void Set##name (type _arg) // run // gcc -E file.cpp // to see the precompiler output int main() { SetMacro(Te…') (current)
- 08:36, 23 June 2010 (diff | hist) . . (+24) . . Main Page (→C++)
- 08:35, 23 June 2010 (diff | hist) . . (+709) . . N CPP/Logging (Created page with '==Logging.cpp== <source lang="cpp"> #include <iostream> #include <fstream> using namespace std; void ChangeCoutDestination(); void LogToScreen(); void LogToFile(); int main() {…') (current)
- 08:34, 23 June 2010 (diff | hist) . . (+26) . . Main Page (→C++)
- 08:34, 23 June 2010 (diff | hist) . . (+50) . . Main Page (→C++0x)
- 08:31, 23 June 2010 (diff | hist) . . (+10) . . Main Page (→Debugging)
- 08:31, 23 June 2010 (diff | hist) . . (+34) . . N CPP/Assert (moved CPP/Assert to CPP/Debugging/Assert) (current)
- 08:31, 23 June 2010 (diff | hist) . . (0) . . m CPP/Debugging/Assert (moved CPP/Assert to CPP/Debugging/Assert)
- 08:31, 23 June 2010 (diff | hist) . . (+222) . . N CPP/Debugging/LineNumbers (Created page with '==LineNumbers.cpp== <source lang="cpp"> #include <iostream> using namespace std; int main(int argc, char *argv[]) { cout << "Line: " << __LINE__ << endl; cout << "File: " <…') (current)
- 08:30, 23 June 2010 (diff | hist) . . (+62) . . Main Page (→C++)
- 08:26, 23 June 2010 (diff | hist) . . (+616) . . N CPP/IO/FileOutput (Created page with '==FileOutput.cpp== <source lang="cpp"> #include <iostream> #include <fstream> void Overwrite(); void Append(); int main(int argc, char *argv[]) { Overwrite(); Append(); r…') (current)
- 08:24, 23 June 2010 (diff | hist) . . (+3,397) . . N CPP/IO/FileInput (Created page with '==FileInput.cpp== <source lang="cpp"> #include <iostream> #include <fstream> #include <vector> #include <string> #include <sstream> #include <cstdlib> void ReadInt(const std::st…')
- 08:23, 23 June 2010 (diff | hist) . . (+83) . . Main Page (→C++)
- 08:20, 23 June 2010 (diff | hist) . . (+1,091) . . N CPP/Infinity (Created page with '==Infinity.cpp== <source lang="cpp"> #include <iostream> #include <limits> bool IsInf(const double a); bool IsMinusInf(const double a); int main(int argc, char *argv[]) { …') (current)
- 08:19, 23 June 2010 (diff | hist) . . (+28) . . Main Page (→C++)
- 08:19, 23 June 2010 (diff | hist) . . (+274) . . N CPP/C++0x/Hash (Created page with '==Hash.cpp== <source lang="cpp"> #include <iostream> #include <functional> //hash int main(int argc, char* argv[]) { std::hash<const char*> H; std::cout << "foo -> " << H("…')
- 08:18, 23 June 2010 (diff | hist) . . (+40) . . Main Page (→STL Data Structures)
- 08:16, 23 June 2010 (diff | hist) . . (+334) . . N CPP/FunctionPointer (Created page with '==FunctionPointer.cpp== <source lang="cpp"> #include <iostream> using namespace std; void add(int a, int b); void DoThing(void (*pt2Func)(int,int)); int main(int argc, char …')
- 08:16, 23 June 2010 (diff | hist) . . (+43) . . Main Page (→C++)
- 08:15, 23 June 2010 (diff | hist) . . (+271) . . N CPP/Classes/FriendClass (Created page with '==FriendClass.cpp== <source lang="cpp"> #include <iostream> //forward declaration class B; class A { private: friend class B; int a; public: }; class B…')
- 08:14, 23 June 2010 (diff | hist) . . (+43) . . Main Page (→Classes)
- 08:12, 23 June 2010 (diff | hist) . . (+660) . . N CPP/Exceptions (Created page with '==Exceptions.cpp== <source lang="cpp"> #include <iostream> #include <fstream> using namespace std; int main() { try { // Statements that may throw exceptions you want t…') (current)
- 08:11, 23 June 2010 (diff | hist) . . (+32) . . Main Page (→C++)
- 08:11, 23 June 2010 (diff | hist) . . (+430) . . N CPP/Enum (Created page with '==Enum.cpp== <source lang="cpp"> #include <iostream> enum PointType { GOOD, BAD, UNINFORMATIVE }; int main(int argc, char *argv[]) { PointType A = GOOD; if(A == GOOD) …')
- 08:10, 23 June 2010 (diff | hist) . . (+20) . . Main Page (→C++)
- 08:09, 23 June 2010 (diff | hist) . . (+43) . . Main Page (→Classes)
- 08:08, 23 June 2010 (diff | hist) . . (+1,247) . . N CPP/Loops/DoWhile (Created page with '==DoWhile.cpp== <source lang="cpp"> #include <iostream> #include <string> #include <cstdlib> #include <sstream> #include <fstream> int main(int argc, char *argv[]) { if(argc !…') (current)
- 08:08, 23 June 2010 (diff | hist) . . (+100) . . Main Page (→Classes)
- 08:06, 23 June 2010 (diff | hist) . . (+798) . . N CPP/Classes/DerivedClass (Created page with '==DerivedClass.cpp== <source lang="cpp"> #include <iostream> #include <string> class Person { public: std::string Name; Person(){} }; class Child : public Per…') (current)
- 08:06, 23 June 2010 (diff | hist) . . (+45) . . Main Page (→Classes)
- 08:04, 23 June 2010 (diff | hist) . . (+254) . . N CPP/Classes/InitializationList (Created page with '==InitializationList.cpp== <source lang="cpp"> #include <iostream> class Point { public: Point(int NewValue) : a(NewValue) {} int a; }; int main(int argc, char* argv[…')
- 08:04, 23 June 2010 (diff | hist) . . (+57) . . Main Page (→Classes)
- 08:01, 23 June 2010 (diff | hist) . . (+228) . . N CPP/DefaultArguments (Created page with '==DefaultArguments.cpp== <source lang="cpp"> #include <iostream> #include <limits> void Test(int a = 5); int main(int argc, char *argv[]) { Test(); return 0; } void Test(i…')
- 08:01, 23 June 2010 (diff | hist) . . (+73) . . Main Page (→C++)
- 07:59, 23 June 2010 (diff | hist) . . (+371) . . N CPP/Strings/CountCharacters (Created page with '==CountCharacters.cpp== <source lang="cpp"> #include <iostream> #include <algorithm> #include <string> int main() { std::string content = "A table and A chair and A desk"; c…') (current)
- 07:59, 23 June 2010 (diff | hist) . . (+51) . . Main Page (→Strings)
- 07:58, 23 June 2010 (diff | hist) . . (+753) . . N CPP/Classes/ConstructorInheritance (Created page with '==ConstructorInheritance.cpp== <source lang="cpp"> #include <iostream> #include <string> class Person { private: protected: std::string m_Name; public: Pe…') (current)
- 07:56, 23 June 2010 (diff | hist) . . (+65) . . Main Page (→Classes)
- 07:55, 23 June 2010 (diff | hist) . . (+741) . . N CPP/Templates/ClassTemplateExplicitInstantiation (Created page with '==ClassTemplate.cpp== <source lang="cpp"> #include <iostream> #include <vector> #include "Point.h" using namespace std; int main(int argc, char* argv[]) { Point<double> A; …')
- 07:54, 23 June 2010 (diff | hist) . . (+64) . . Main Page (→Strings)
- 07:52, 23 June 2010 (diff | hist) . . (+1) . . Main Page (→Strings)
- 07:52, 23 June 2010 (diff | hist) . . (+33) . . N CPP/CompareStrings (moved CPP/CompareStrings to CPP/Strings/Compare) (current)
- 07:52, 23 June 2010 (diff | hist) . . (0) . . m CPP/Strings/Compare (moved CPP/CompareStrings to CPP/Strings/Compare) (current)
- 07:51, 23 June 2010 (diff | hist) . . (+313) . . N CPP/Strings/Concatenate (Created page with '==Concatenate.cpp== <source lang="cpp"> #include <iostream> #include <string> #include <sstream> using namespace std; int main() { string test; test = "hello"; int scan =…')
- 07:51, 23 June 2010 (diff | hist) . . (+60) . . Main Page (→C++)
- 07:49, 23 June 2010 (diff | hist) . . (+416) . . N CPP/Strings/Compare (Created page with '==CompareStrings.cpp== <source lang="cpp"> #include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { string Hello = "Hello"; string Go…')
- 07:48, 23 June 2010 (diff | hist) . . (+41) . . Main Page (→C++)
- 07:48, 23 June 2010 (diff | hist) . . (+849) . . N CPP/CommandLineArguments (Created page with '==CommandLineArguments.cpp== <source lang="cpp"> #include <iostream> #include <string> #include <sstream> using namespace std; //test with //24.5 90.3 int main(int argc, char …')
- 07:47, 23 June 2010 (diff | hist) . . (+54) . . Main Page (→C++)
- 07:46, 23 June 2010 (diff | hist) . . (+645) . . N CPP/KeyboardInput (Created page with '==KeyboardInput.cpp== <source lang="cpp"> #include <iostream> #include <string> using namespace std; void ReadFromKeyboard(void); int main() { ReadFromKeyboard(); return …') (current)
- 07:46, 23 June 2010 (diff | hist) . . (+39) . . Main Page (→C++)
- 07:45, 23 June 2010 (diff | hist) . . (+254) . . N CPP/CharacterArray (Created page with '==CharacterArray.cpp== <source lang="cpp"> #include <iostream> void Function(const char* word); int main(int argc, char *argv[]) { Function("hello"); return 0; } void…') (current)
- 07:45, 23 June 2010 (diff | hist) . . (+41) . . Main Page (→C++)
- 07:44, 23 June 2010 (diff | hist) . . (+570) . . N CPP/Casting (Created page with '==Casting.cpp== <source lang="cpp"> #include <iostream> void StaticCast(); int main(int argc, char *argv[]) { StaticCast(); return 0; } void StaticCast() { double …')
- 07:38, 23 June 2010 (diff | hist) . . (+26) . . Main Page (→C++)
- 07:37, 23 June 2010 (diff | hist) . . (+219) . . N CPP/ExecuteLinuxCommand (Created page with '==ExecuteLinuxCommand.cpp== <source lang="cpp"> #include <iostream> #include <cstdlib> //for system() int main(int argc, char *argv[]) { std::string Command = "ls"; system(C…') (current)
- 07:37, 23 June 2010 (diff | hist) . . (+54) . . Main Page (→C++)
- 07:35, 23 June 2010 (diff | hist) . . (+906) . . N CPP/BinaryIO (Created page with '==BinaryIO.cpp== <source lang="cpp"> #include <iostream> #include <fstream> #include <cstdlib> using namespace std; void CWrite(); void CPPWrite(); string Filename = "Test.b…') (current)
- 07:35, 23 June 2010 (diff | hist) . . (+43) . . Main Page (→C++)
- 07:34, 23 June 2010 (diff | hist) . . (+151) . . N CPP/Debugging/Assert (Created page with '==Assert.cpp== <source lang="cpp"> #include <iostream> #include <assert.h> int main() { int i = 2; assert(i == 2); return 0; } </source>')
- 07:33, 23 June 2010 (diff | hist) . . (+24) . . Main Page (→C++)
- 07:33, 23 June 2010 (diff | hist) . . (+17) . . m CPP/2DArray (current)
- 07:32, 23 June 2010 (diff | hist) . . (+458) . . N CPP/Array (Created page with '==Array.cpp== <source lang="cpp"> #include <iostream> double* ReturnArray(); int main() { double a[3]; a[0] = 0.5; a[1] = 1.5; a[2] = 2.5; std::cout << a[0] << …')
- 07:32, 23 June 2010 (diff | hist) . . (+22) . . Main Page (→C++)
- 07:22, 23 June 2010 (diff | hist) . . (+1,961) . . N CPP/2DArray (Created page with '<source lang="cpp"> #include <iostream> using namespace std; void FixedLength(); void VariableLength(); void Fill(void* buffer, unsigned int Width, unsigned int Height); void …')
- 07:22, 23 June 2010 (diff | hist) . . (+27) . . Main Page (→C++)
- 07:21, 23 June 2010 (diff | hist) . . (+528) . . N CPP/ZeroPad (Created page with '<source lang="cpp"> #include <iostream> #include <sstream> #include <string> #include <iomanip> std::string ZeroPad(const unsigned int number, const unsigned int rep); int m…') (current)
- 07:20, 23 June 2010 (diff | hist) . . (+42) . . Main Page (→C++)
- 18:43, 22 June 2010 (diff | hist) . . (+342) . . N CPP/STL/MultiSet (Created page with '==MultiSet.cpp== <source lang="cpp"> #include <iostream> #include <set> int main(int, char*[]) { std::multiset<int> S; S.insert(2); S.insert(1); S.insert(1); for(s…') (current)
- 18:42, 22 June 2010 (diff | hist) . . (+2,015) . . N CPP/STL/List (Created page with '==List.cpp== <source lang="cpp"> #include <iostream> #include <list> #include <vector> #include <cstdlib> using namespace std; double RandomDouble(); void Report(list<double> &…') (current)
- 16:26, 22 June 2010 (diff | hist) . . (+519) . . N CPP/STL/MultiMap (Created page with '==MultiMap.cpp== <source lang="cpp"> #include <iostream> #include <map> int main(int argc, char *argv[]) { std::multimap <int, double> MyMap; //create a mapping from "t…')
- 16:25, 22 June 2010 (diff | hist) . . (+3,400) . . N CPP/STL/Vector (Created page with '==Vector.cpp== <source lang="cpp"> #include <iostream> #include <vector> #include <cstdlib> #include <algorithm> #include "TestClass.h" double RandomDouble(); void TestVector(…')
- 16:25, 22 June 2010 (diff | hist) . . (+1,795) . . N CPP/STL/String (Created page with '==String.cpp== <source lang="cmake"> #include <iostream> #include <string> #include <algorithm> #include <functional> void TestEmpty(); void TestConcatenate(); void RemoveCharac…')
- 16:25, 22 June 2010 (diff | hist) . . (+31) . . Main Page (→STL Data Structures)
- 16:24, 22 June 2010 (diff | hist) . . (+4,310) . . N CPP/STL/Map (Created page with '==Map.cpp== <source lang="cmake"> #include <iostream> #include <map> #include <vector> #include <string> void Array2Vec(unsigned char arr[3], std::vector<unsigned char> &out); …')
- 16:24, 22 June 2010 (diff | hist) . . (+3,863) . . N CPP/STL/Set (Created page with '==Set.cpp== <source lang="cpp"> #include <iostream> #include <set> #include <vector> #include <cstdlib> #include "Height.h" double RandomDouble(); void Report(std::set<double>…')
- 16:23, 22 June 2010 (diff | hist) . . (+126) . . Main Page
- 16:12, 22 June 2010 (diff | hist) . . (-2) . . CPP/AlphebetizeString
- 16:05, 22 June 2010 (diff | hist) . . (+750) . . N CPP/AlphebetizeString (Created page with '==Alphabetize.cpp== <source lang="cpp"> #include <iostream> #include <vector> #include <algorithm> #include <string> void Output(std::vector<std::string> &Strings); void Alphabe…')
- 16:05, 22 June 2010 (diff | hist) . . (+2) . . Main Page
(newest | oldest) View (newer 100 | older 100) (20 | 50 | 100 | 250 | 500)