demo code for study cpp