J
Joe Keller
Hello,
In C++, it was always faster and "cheaper" to pass values by reference vs.
by value. Does the same line of thinking hold true with C# in the .NET CF?
For example, assume I have a procedure "Foo" in my application and that
"Foo" requires a parameter "X". In addition, assume that "Foo(X)" is called
quite heavily within the application.
Is it faster and "cheaper" to call "Foo(X)" by passing "X" by reference or
by passing "X" by value?
By Reference:
private void Foo(ref X);
By Value:
private void Foo(X);
Thanks,
Joe
In C++, it was always faster and "cheaper" to pass values by reference vs.
by value. Does the same line of thinking hold true with C# in the .NET CF?
For example, assume I have a procedure "Foo" in my application and that
"Foo" requires a parameter "X". In addition, assume that "Foo(X)" is called
quite heavily within the application.
Is it faster and "cheaper" to call "Foo(X)" by passing "X" by reference or
by passing "X" by value?
By Reference:
private void Foo(ref X);
By Value:
private void Foo(X);
Thanks,
Joe