Y
Yurik
A question to the C# language experts: Why isn't this code valid?
static void Foo( out string s )
{
s = "test";
}
static void Main( )
{
object s; // *** Accept any out type!
Foo( out s );
}
If s is uninitialized at the beginning of Foo, what difference does it
make what type the out value will eventually be assigned to, when the
function finally exits?
Thanks!
static void Foo( out string s )
{
s = "test";
}
static void Main( )
{
object s; // *** Accept any out type!
Foo( out s );
}
If s is uninitialized at the beginning of Foo, what difference does it
make what type the out value will eventually be assigned to, when the
function finally exits?
Thanks!