some C++ sample codes