Some random problems on C++