change cpp code of example