fix c++ bug and add c++