sample code for c++