It's said that class objects are allocated on heap using new, and struct object can declare directly on stack. But if I use "new" to allocate a struct, where is it stored? Like this:
struct MyStruct
{
public int mI;
public string mS;
}
MyStruct s1;
s1.mI = 1;
s1.mS = "ab";
MyStruct s2 = new MyStruct
{
mI = 2,
mS = "xy"
};
I know "s1" is on heap, what about "s2"?
Thanks a lot.