Okay so I am creating a C++ program, currently on linux. The program has data saved into a file that it needs to access and write to. I'm working on installing my program to /usr/local/bin , but where do files associated / necessary for a program usually get stored?
Putting the text file in /etc doesn't work because then I can't write to the file unless I call my program with sudo permissions. Likewise, /usr/local/share with a directory for my program doesn't work either for the same exact reasons.
What is the typical solution for this or how do people get around this? Where should I be storing the files for my program that it needs to read from and write to? I'm not sure if I'm wording my question incorrectly but just can't really find any insight to this online.