[pt_view id="85ccb811a9"]
Continue ReadingC++: What does the explicit keyword in C++ mean?
Someone posted in a comment to another question about the meaning of the explicit keyword in C++. So, what does it mean? Skizz Answer: In C++, th
Continue ReadingC++: Knight’s Tour
Problem: you have a standard 8x8 chessboard, empty but for a single knight on some square. Your task is to emit a series of legal knight moves that re
Continue ReadingC++: Find the Missing Permutation
These are all of the permutations of the symbols A, B, C and D, except for one that's not listed. Find that missing permutation. (cf. Permutations)
Continue ReadingC++: Define a Primitive Data Type
Demonstrate how to define a type that behaves like an integer but has a lowest valid value of 1 and a highest valid value of 10. Include all bounds ch
Continue ReadingC++: Black Scholes Call Option Gamma
// Calculate the Black Scholes European call option Gamma double BS_Call_Option_Gamma(double S, double K, double r, double v, double T) // Para
Continue ReadingC++: Why does changing 0.1f to 0 slow down performance by 10x?
Why does this bit of code, const float x[16] = { 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1,
Continue ReadingC++: Cycles in family tree software
I am the developer of some family tree software (written in C++ and Qt). I had no problems until one of my customers mailed me a bug report. The probl
Continue ReadingC++: Include a File
The task is to demonstrate the language's ability to include source code from other files. In C and C++, inclusion of other files is achieved via a
Continue ReadingC++: Function Composition
Create a function, compose, whose two arguments f and g, are both functions with one argument. The result of compose is to be a function of one argume
Continue Reading




