Learning how to use classes in C++