Add io example code for c++