Im sorry i just wrote something to get my point accross.
Here is an actual example code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CacheScratch
{
class Class1
{
public const int a = 0xABAC;
int test()
{
return sizeof(a);
}
}
}
If i have a const, why do i get the error: Severity Code Description Project File Line Suppression State Error CS0233 'a' does not have a predefined size, therefore sizeof can only be used in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf)
Why do I need a Marshal for a fixed size variable?