really need to type [Fieldoffset] at every data declaration?
Can anybody sahre a simple way to create unions in C#?
I thought this was a C# group
I fail to see why you'd at all use unions in C# as they're mostly used for low level - ps. embedded - programming in C
I'm kinda new in C#, I come from C/C++ languages and right now I need to implement something union-like data type. I've tried to use var but it doesn't work for my purposes
I've seen some tutorials for something similar to unions but it doesn't make their point straightforward
I assume you can try the good ol' ","
[attribute] public int a, b, c, d, e;
You could just use the dynamic type. dynamic varName = 1;
But idk the issue you're trying to solve, so, maybe this ain't it.
Thanks though I changed my approach of the problem so I figure it out in a different way
Обсуждают сегодня