Structures

A structure or struct is a way to aggregate or group related data together while giving each piece of data a distinct name, unlike tuples. We'll explore; in this chapter, how to define and instantiate structs, access data and call special functions called methods on instances of structs.

Note

Variables of a struct care called member variables while functions are called methods. Together, these form the members of the struct.