It seems variables are used differently in this language than in C++.
For some reason, you have to have a static variable defined like this:
Expand|Select|Wrap|Line Numbers
- public static uint Somenum
- {
- set { m_somenum = value; }
- get { return m_somenum; }
- }
public uint m_sumenum;
This seems to be the only way to expose a member of a class to other classes in C#.
The problem is that I seem to be doing this improperly because I get a compile error:
An object reference is required for the non-static field, metod, or property '.......m_somenum"
I think I see the problem. The problem is that I cannot use a static varable like this.
So you have to instantiate the class in order to set these members of the class.
So how would you do the equivalent of a global class in C Sharp?
Would I do it something like this:
Expand|Select|Wrap|Line Numbers
- public clase SomeClass
- {
- SomeClass someclass = new SomeClass();
- public static uint Somenum
- {
- set { m_somenum = value; }
- get { return m_somenum; }
- }
- }