gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
... but is there a way to do it using C only?
C programs execute in memory. Once that process' memory is unloaded (i.e. the program exits) the values stored there are no longer valid. You can do several things to create persistent memory - which you choose depends on your needs.Use a lightweight database
Use a file
Use a system facility (Windows registry)
Run a process that manages the values and register with that[1]
[1] Of course, this approach requires you to eventually store the data when it exits. This would be something like a daemon in UNIX or a service in Windows.
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124