I think you'll need to declare that int as 'static' -- otherwise it won't be remembered from one cycle to the next:
Code:
static int count = 0;
Also, if you want to declare it in one place and increment it in another you will need to declare it as global, which means outside of all functions:
Code:
// this is global:
static int count = 0;
User_Initialization()
{
static int anotherCount = 0; // this is local to this function,
// and cannot be seen outside of
// this fuction.
count++; // okay
anotherCount++; // okay
}
anotherFunctionInTheSameFile()
{
count++; // okay -- it's global
anotherCount++; // won't compile
}
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the
USPTO.
My favorite error message from gcc:
main is usually a function
My favorite error message from Windows:
There is not enough disk space available to delete this file.