// archives

struct

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 [...]

Passing and Returning Structures

Passing structures by value makes the most sense when the structure is relatively compact

So let’s look at a couple examples along those lines

The first example deals with travel time (not to be confused with time travel)

Some maps will tell you that

It is 2 hours, 56 minutes, from Zero One City to Binary Falls
And 1 hour, [...]