code for c++ class