// archives

Structures

This tag is associated with 2 posts

Structures

Sometimes it is useful to have a collection of values of different types and to treat the collection as a single item

For example, consider a bank certificate of deposit, which is often called a CD

A CD is a bank account that does not allow withdrawals for a specified number of months
A CD naturally has three [...]

Member Access Control: Public or Private?

You can declare class members

Whether they are data items or member functions

Either in the public or the private section of a class

 

But because one of the main precepts of OOP is to hide the data

Data items normally go into the private section

 

The member functions that constitute the class interface

Go into the public section

Otherwise, you can’t [...]