Triabolical_ t1_ixjwabm wrote
Reply to comment by oneeyedziggy in ELI5: What is the difference between classes, constructors, structs and methods in C# by Sure-Ad-5053
> Is this even relevant to the situation either in c# having such qualifiers or in classes and structs being sufficiently similar for that to be feasible (if only everything had been different)?
C++ is pretty much that way; structs and classes are mostly the same thing and the developer chooses whether they want to allocate it on the stack or whether they want to put it in dynamic memory.
In C# - and managed languages in general - class instances are always allocated in dynamic memory. Structs were really just added for windows interop, though they do have other limited uses.
Viewing a single comment thread. View all comments