cpp learning: add example of function advance