correcting examples to match c and c++ api