How would you create a header that does the function of reading files in C ++
This may sound like a newbie, but I'm trying to make an outer header that does a function that reads a name from a file, like joey, and stores it as a variable in other code that it reads, but I can't figure it out ... It will so ... One code will get that name and it will write it to a file ... Then I want to use that header to read that file without typing the full code again, but I can't seem to find a way to store the name read by the variable.
Ok, this is not very clear. Can you post something like pseudocode to explain this?
If I understand you at all, you want to write data to a file in one place and read it from other places, and you want the code to read it in the header. Nothing is impossible about it, but there are many easier ways to handle it.
a source to share