write in c++ and define class