c++ attempt