A small help in understanding structs:
I am learning how to use structs and have a question. for this question I decided to write a small test program by using some structs.
Inside Program.cs
Inside Class1.cs file:
Inside Class2.cs file:
Am I correct in assuming that when I am calling ProcessTest method from Program.cs file, a copy of the struct object is created in memory when Class1 is being processed ? I assume that if I use a class instead of a struct for ProcessTest method, I would only be passing it as a reference to the class object and in that case, a copy of the object isn't created when Class1 is being processed
Inside Program.cs
Inside Class1.cs file:
Inside Class2.cs file:
Am I correct in assuming that when I am calling ProcessTest method from Program.cs file, a copy of the struct object is created in memory when Class1 is being processed ? I assume that if I use a class instead of a struct for ProcessTest method, I would only be passing it as a reference to the class object and in that case, a copy of the object isn't created when Class1 is being processed