convert the src from c to c++