Structs 102

While we have defined our own structs, we also have access to a structure known as a unit-like struct. Unlike our own structs, we can see the likes of the following:

struct someStruct; 
let x = someStruct; 

They have nothing after them—no fields defined. These are not the same as the ones we defined, so how do they work?

To understand how they work, we need to understand a tuple struct and, in order to understand those, we need to know what a tuple is.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset