cpp -> c in c style implementation