I'm writing a program that will hold hundreds of strings. Sadly, they are all unique, so I can't use any clever ways to generate them. I need advice on how to store these hundreds of strings. I do not want them to be edited by the user in any way. I just need them waiting to be called into the output display.
Is there anywhere to put hundreds of strings other than in the main function? I was just wondering if there was somehow a better way.
Not sure what you mean by "edited by the user"; the client of the code or the user of the program?
Anyway, depending on what you mean, here's my solutions:
Make them a const static container inside some function that you can access them from. static makes them live for the lifetime of the program.