slash shogdhe
slash shogdhe

Reputation: 4197

Nominal storage allocation of object in c#

In Visual Basic Nominal storage allocation of object is system dependent.

4 bytes on 32-bit platform

8 bytes on 64-bit platform

http://msdn.microsoft.com/en-us/library/47zceaw7.aspx

my question is what is the size of Nominal storage allocation of object in c# and is it system dependent?

Upvotes: 2

Views: 142

Answers (2)

Leo
Leo

Reputation: 14850

It is exactly the same. Remember that both languages are high-level languages and "platform-independent" that are compiled to MSIL. It is inherent to any CLI language. That is, neither C# nor VB run on your machine, it is the actual MSIL that gets compiled at runtime, at the end all of them get "translated" to the same language. Normally, you shouldn't need to care about this, chances are that if you need to be in control of this stuff you might need a lower level language where you have to do memory management by yourself such as C++, C, etc.

Upvotes: 2

nvoigt
nvoigt

Reputation: 77364

There is no difference. Why? Because VB and C# in the end use .NET and the .NET type (second column in your link) will always behave the way you described, regardless of actual language that lead to this type.

Upvotes: 2

Related Questions