If you have a counter that gets incremented through multiple functions, is it better to use a global counter or pointer counter? They both work just curious which is better and why.
Recommended Answers
Jump to PostMy personal preference would be to use a global (and document it well). It's the most straightforward and simplest way. Creating a class for a simple counter or throwing pointers around helter-skelter just muddies things up. If you wanbt an analogy, purists say that you should never ever use a …
All 3 Replies
rproffitt
2,580
"Nothing to see here."
Moderator
Peleg
0
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
rproffitt
commented:
Code for money or grades it seems.
+15
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.