If you have a variable of class type, you can access its instance variables and call its methods using the member operator ".": ItemInfo item; ... double total = item.price; cout << "Color: " << item.getColor();
ItemInfo item; ... double total = item.price; cout << "Color: " << item.getColor();