Added a complete working example for both C and Cpp