Structures are value types; when we pass instances of a structure in our application, we pass a copy of the structure and not the original structure. Classes are reference types; therefore, when we pass an instance of a class within our application, a reference to the original instance is also passed. It is very important to understand this difference. We will discuss a very high-level view here and will provide additional details in Chapter 16, Memory management.
When we pass structures in our application, we are passing copies of the structures and not the original structures. This means that the function gets its own copy of the structure, which it can change as needed without affecting the original instance of the structure.
When we pass an instance of a class in our application, we are passing a reference to the original instance of the class...