

Structs in C vs Structs in C++ vs Structs in C# - digitalsol
http://www.developingthefuture.net/c-structs-vs-c-sharp-structs-vs-c-plus-plus-structs/

======
scott_s
_Also, the struct in C++ is allocated on the heap._

Not correct. Just as in C, in C++, all objects - be they primitive types,
instances of structs or classes - are allocated on the stack by default. If
you want them allocated on the heap, you must explicitly request it.

~~~
digitalsol
You are right, that was a typo. I changed that yesterday.

------
crpatino
Interesting description of what structs are in C#. However, I found the
descriptions in C and C++ very lacking, specially the nonsense about stack vs
heap allocation.

------
adamnemecek
"Also, the struct in C++ is allocated on the heap." I'm probably
misunderstanding what the author wanted to say but this is not correct.
Structs are by default allocated on the stack.

~~~
digitalsol
You are right, that was a typo. I changed that yesterday.

Best Regards

