C
C#8mo ago
16Bit_Felix

❔ Structure keeps on nulling a field

Hello, there. I'm currently struggling with a problem, which includes a struct of mine that keeps on nulling an uint[] field named "_indices" (which is initialised with a field initialiser) after exiting the constructor. I've tried to initialise it in the constructor instead, but to no avail... Turning the struture into a class seems to fix the problem, but i would like to keep it as a struct
5 Replies
16Bit_Felix
16Bit_Felix8mo ago
The source code:
Pobiega
Pobiega8mo ago
Why do you want to keep it a struct? arrays are reference types, so this struct of yours will go on the heap regardless
16Bit_Felix
16Bit_Felix8mo ago
because of pointers
Accord
Accord8mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts