savagerx
February 6th, 2003, 12:20 PM
In C++, we can do this,
void SomeFunctions(int &a){...}
But in C#, I used,
public SomeFunctions(ref int a) and the compiler says invalid argument.
i.e.
...
int x=0;
SomeFunctions(x);
...
Then I tried this,
public SomeFunction(ref Object a) and the compiler says cannot convert Object from int.
I thought C# is able to auto-box int to an Object?
So now, I'm jammed here, how should I proceed?
void SomeFunctions(int &a){...}
But in C#, I used,
public SomeFunctions(ref int a) and the compiler says invalid argument.
i.e.
...
int x=0;
SomeFunctions(x);
...
Then I tried this,
public SomeFunction(ref Object a) and the compiler says cannot convert Object from int.
I thought C# is able to auto-box int to an Object?
So now, I'm jammed here, how should I proceed?