lakshmankoneru
asked on
static variables
Can anyone explain this...................... .......... ........
Static variables declared within nonshared methods are per instance: each instance of the type that contains the method has its own copy of the static variable.
I need to create static variables per instance..... in my application... is it possible... Please let me know?
thanks,
Lakshman
Static variables declared within nonshared methods are per instance: each instance of the type that contains the method has its own copy of the static variable.
I need to create static variables per instance..... in my application... is it possible... Please let me know?
thanks,
Lakshman
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxorilanguageequivalentskeywords.asp
under Misc. Lifetime (second chart from bottom) no C# equivalent ... mostly for the reasons shown.
under Misc. Lifetime (second chart from bottom) no C# equivalent ... mostly for the reasons shown.
out of curiosity isnt a static variable scoped to an instance really an instance variable ?
public class foo {
private int bar;
public void test() {
bar += 1;
}
}
this would be scoped to the instance no ?