thumbtacks2 wrote:
In C#, it's my understanding that variables are created as objects.
That depends. Primitive types are primitive and have a fixed size - ints are 32bit, longs are 64bit and so forth. Here's a
reference of the C# primitive types and their sizes.
It might also be a good idea to read up on boxing and unboxing to understand the meaning of an integer being both a primitive value type and also being an object inheriting from System.Object. Here's the
MSDN lowdown. In a nutshell, an int will be a stack-allocated value as long as you treat it as such. Once you decide to treat it as an object (casting, polymorphism and the like) it will automatically be wrapped in a heap-allocated object.