previous | index | next

Classes vs. Structs

A C++ class is very much like a struct with function (method) members.

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();

previous | index | next