0

Hi I have a struct in my form, and I need to pass a reference/handle to it to a separate class, which is ok with the simple "ref" keyword. Now, how do I store this ref to a struct in the class (as a member variable)? Is this possible? I hope so...

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by pseudorandom21
0

simple, just create a variable with the struct inside class...
struct MYStruct
{

}

class MyClass
{
MYStruct instanceMyStruct; // create a property if you want to..
}

0

Is it possible with this "boxing" thing I've heard of? Like making it an "object" instance and using that?

0

i suppose it shud work, because MYStruct is a type of object, so boxing should work.
can u try that out..?

0

i suppose it shud work, because MYStruct is a type of object, so boxing should work.
can u try that out..?

I haven't been using C# much and it isn't my first language, I don't know how to do it so I was hoping you could show me in a line or two, but ok.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.