There was a loooooong time, since I actually encoded directly c (even C ++, but c), and I know how to use the extern keyword to exchange a variable between individual .c files, but that I cannot remember how share persistent data between files?
For example, say I have this ... (notice, this is not c-code (or if so, its an accident), but rather a pseudo-code to show what I want):
const char const * WEEKDAYS[] = { "Sunday", "Monday", "Tuesday" }
Now I'm trying to create an array of char pointers that point to data. Again, this is persistent data, so I would just like to define it in the header directly, but where I canโt figure out how to do this, or if itโs not how you should do it, and you should still declare it in the c file, then use extern in the header that you included elsewhere.
Again, I havenโt done this for a long time thanks to new, more modern languages, but I hope you can help.
source share