Jump to content
  • Advertisement
Sign in to follow this  
dk32321

Counting how many times your program has ran

This topic is 4491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way to put a hit counter in c++ to see how many times your program has been ran.

Share this post


Link to post
Share on other sites
Advertisement
well... there are two different things you can do from what I can see. one is to store a counter in an external resource (a file, registry, DB, whatever) this is probably the easier thing to do. When the program runs, read the value, increment, and store the value.

The second approach is probably be you and me. it involves modifying the compiled binary. While possible its probably not a good idea at all to even consider using.

Share this post


Link to post
Share on other sites
Absolutely! However, you will need to store this information someplace "outside" your program itself - a file, the Windows Registry, etc. The best place for this depends partially on what platform you are programming on, and what your current C++ skills are like. Are you familiar with file access?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
how can i use a .db file or a registry file to increment the counter and output the results in the console.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!