| | |
What's the diference between STRUCTS and OBJECTS in C#??
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
A struct defines a value type; a class defines a reference type.
A value type is one whose values cannot be separated from the variable. If you try copying it to a different variable, you'll make a complete copy. You don't really modify value types -- you modify the variables that contain them.
Compare this with class types, where variables contain references that point to objects -- where two variables of that type may contain references that point to the same object.
A value type is one whose values cannot be separated from the variable. If you try copying it to a different variable, you'll make a complete copy. You don't really modify value types -- you modify the variables that contain them.
Compare this with class types, where variables contain references that point to objects -- where two variables of that type may contain references that point to the same object.
![]() |
Other Threads in the C# Forum
- Previous Thread: Get index of an enum by value
- Next Thread: Snippet - My first app - Opinions? Suggestions?
| Thread Tools | Search this Thread |
.net access ado.net algorithm array asp.net barchart bitmap box broadcast buttons c# check checkbox client color combo combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees developer development draganddrop drawing encryption enum equation event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot math mathematics mouseclick mysql nargalax operator path photoshop picturebox pixelinversion post programming radians regex remote remoting restore richtextbox saving serialization server sleep socket sql stack statistics stream string table tcp text textbox thread time timer update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






