Hello there, I'm trying to write a program that reads user name, ID and puts them in a file then reads them. Mine doesn't seem to be doing that though. I want it to write the user data from [0] and put it in [1] by putting it into the file first then reading it. What am I doing wrong? Compiles fine but file is 0 bytes.
The data might be written only after an explicit flush or when the file is closed. Thus you will see the data only when you program ends completely since you do not an explicit flush or close.