This question already has an answer here:
- Overhead of a .NET array? 5 answers
If I have:
int[] d = {1,2,3};
which is the exact allocated space in memory of the array object referenced by d
?
Is it only 3 * 4 = 12
byte or there are other bytes like in Java (i.e. object header, padding, and so on)?
P.S.
I noticed that I can't use sizeof
operator...
sizeof
is not as straight-forward an operation. – D Stanley Dec 7 '15 at 14:13sizeof
? This is not C++. This is completely different language. Actually, you can do something like sizeof with Marshal.SizeOf – quetzalcoatl Dec 7 '15 at 14:14