C++ sample codes