Initial C++ program

fix seg fault