Int Parameter as Object

I have a method that accepts an ref object as a parameter.  How can I pass an integer into that method as a ref object????

Thanks,
Kendal
gvector1Asked:
Who is Participating?
 
AlexFMCommented:
This is result of my test:

        static void Main(string[] args)
        {
            int n = 0;
            object o = n;

            Method(ref o);
            n = (int)o;

            Console.WriteLine(n);
        }

        static void Method(ref Object o)
        {
            o = 3;
        }
0
 
devsolnsCommented:
It will be automatic via Boxing.

http://www.google.com/search?hl=en&q=c%23+boxing
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.