For local variables, a struct instance is allocated on the stack by default. To allocate on the heap, use new: S* p = new S; assert(p.i == 0);.
確定! 回上一頁