What I'm trying to do is create a customer class with a type customer that will contain customer information like name, account, etc. I tried setting up something similar to what I've seen in class, but as you'll see in the code below, when I make a pointer 'a' to a new customer with info inputted it outputs an address. Any idea what I'm doing wrong or maybe a better way to do it? Thanks
Since a is a pointer, if you output a it will display the memory address that a is pointing to. In order to access the data that a points to, you must dereference it by putting *a instead of just a. However, you cannot simply put "cout << *a << "\n";". Unless you overload the << operator, something your class probably hasn't covered yet, this will not work. So, you have to output each variable of the class separately.