c implement c++ class