Empty string

  • Thread starter Thread starter M D
  • Start date Start date
I wanted to call:

foo(ref new string('\0',0), 0); //such intuitive syntax
..
</snip>

If that would be possible in C#, it would be the same as:

foo(ref "", 0);

(besides, it would be the same instance as any other "" literal; but tha is
only remarkable by reference comparison)

ref doesn't mean your giving an object reference to the method.
it means your giving a variable reference to the method.

Christof
 
You are correct. I figured it was like:

for (int i=0; i<somearray.len; i++)
somearray = new StreamWriter(i.ToString()+"outfile.txt");

where I never have to name the object.

ref won't let you do that. That explains why none of the suggestions
worked.

my apologies.

thx
md
 
Back
Top