some small c++ sample code.