add example how to define in cpp