Memory examination in c++