Counters and Functions

Is it better to a) declare a new counter in every function that needs one. b) parse an existing counter in main() as an argument into each function. c) declare the counter as a global variable. Or any other suggestions welcome =).
Just wondering what would be better coding standards or does it not really not matter.
Thanks.
The a) is a better.
It's thread safe if the counter is not static data.
It's easy to support.
What kind of counter are you referring to?
@Athar: Just one to use in a for loop.
In that case, a) is not just better, it is the only acceptable way.
Variables should always be as local as possible.
Ok. Thanks for the quick replies.
Topic archived. No new replies allowed.