convert from c to cpp