C++ attempt