+ 1
Is there a way to record how many times a program is run in c++?
It could be used as the seed for random numbers, of course I could just use the time, but I'm just wondering.
3 Respostas
+ 5
You can have it append an external file each time it is run
+ 3
as arthur has mentioned, you can use an external file to record how many times it ran.
+ 2
Of course, the user might delete it at anytime. There are system dependent storage that is less likely to disappear (windows registry), but nothing is guaranteed. Some software updates a static variable in the executable file. But, a determined user can change that. Every way I know about can be broken, unless it is a feature of the os.