Am I overlooking something why does "static" only work for global var and not for local var?
static int i = 0
void test()
{
print i "\n"
i++
}
test()
test()
output
0
1
void test()
{
static int i = 0
print i "\n"
i++
}
test()
test()
output
0
0
SystemAdmin - Thu Mar 14 09:38:07 EDT 2013 |
Re: Static variables Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |