On line 8, we create a std::array of ints that we wish to sort. On line 10, we call the standard alrogithm std::sort, which sorts the range of elem
Continue ReadingC++: Execute a System Command
In this task, the goal is to run either the ls (dir on Windows) system command, or the pause system command. Works with: Visual C++ version 2005 sys
Continue ReadingC++: Swap Values
On lines 6–7, we create two std::string objects whose values we wish to swap. However, this sample will also apply to any other swappable type. O
Continue ReadingC++: Input Loop
Read from a text stream either word-by-word or line-by-line until the stream runs out of data. The stream will have an unknown amount of data on it.
Continue ReadingC++: Munching Squares
Render a graphical pattern where each pixel is colored by the value of 'x xor y' from an arbitrary color table. #include <windows.h> #
Continue ReadingC++: What is the name of the “–>” operator?
After reading Hidden Features and Dark Corners of C++/STL on comp.lang.c++.moderated, I was completely surprised that it compiled and worked in both V
Continue ReadingC++: Hofstadter Q Sequence
The Hofstadter Q sequence is defined as: It is defined like the Fibonacci sequence, but whereas the next term in the Fibonacci sequence is th
Continue ReadingC++: Ludic Numbers
Ludic numbers are related to prime numbers as they are generated by a sieve quite like the Sieve of Eratosthenes is used to generate prime numbers.
Continue ReadingC++: Quicksort
#include <functional> #include <algorithm> #include <iterator> template< typename BidirectionalIterator, typename Compar
Continue ReadingC++ Language Concepts
[pt_view id="016a1aed85"]
Continue Reading




