Possible Duplicate:
Static variables in C#
If you have a large function and in the middle somewhere you have a value that should be declared only the first time its encounter.
In c++ you can use static for this:
void func() {
...
...
static double startPosition = 0.0;
int var = startPositino - value;
startPosition = var;
...
}
But in c# you cant have static variables inside a function, is there some other way to do this without declaring it outside the function?