On Sat, 31 Mar 2007 07:40:58 -0700, Mark S. <marks@yahoo.comwrote:
Quote:
This seems to work, but I wish I could get the other version to work. I
looked at pointers, except it requeres /unsafe...
I'm not really clear on what it is you're trying to do. The two examples
you've provided don't really do the same thing, though they are similar.
In the former case, you appear to want a reference to a reference with a
lifetime outside a method. In the second case, you seem satisfied to have
a reference to a reference that exists only for the duration of a method.
Both are useful, but they aren't really the same thing.
For what it's worth, as far as I know there's no variable type that gives
you a reference to a reference in C#, except in the contexts you've
already identified (using pointers, and using the "ref" keyword..."out"
work similarly, of course).
Also for what it's worth, I wouldn't call this a "dynamic variable name".
When I read that, I got the impression you wanted a variable that has an
automatically generated name, or a name that can change over time.
Neither have anything to do with what you're trying to do.
Pete