Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
My
own favorite C++ code snippets, for anyone to use freely. Note
that some snippets fall under multiple categories. Some snippets are trivial
for most people, but I put them here for completeness and for newbies
(including my own students).
For VCL code snippets, go to the VCL code snippets page.
I
cite my sources whenever someone else published a version of the snippet before
me, although I have always modified the original. All snippets should compile
cleanly after a copy-paste. Feel free to contact me when one snippet does not (view my E-mail address).
1.
ASCII art (both STL and VCL)
2.
Benchmarks
3.
Biology
5. Checks
6. Containers
9.
File I/O
10.
Functor
11.
Graphics
(both STL and VCL, but not
using TImage)
12.
int
13.
map, std::map
14.
Math
15.
Maze
17.
Random Number
18.
Sort
19.
std::cout
20.
std::map
21.
std::string (note that many container code snippets will also
work on std::string)
22.
std::vector (note that many container code snippets will also
work on std::vector)
23.
string, std::string (note that many container code snippets will also
work on std::string)
24.
TImage
25.
Tools
26.
VCL
27.
VCL, TImage
28.
vector, std::vector (note that many container code snippets will also
work on std::vector)