So I have a txt file that looks like this:
112 12.50 Y 15
267 7.75 N 20
382 15.50 N 45
User is prompted where he wants to insert
The only option that you have to add information in the middle of a file without overwriting old data is to move manually all the data following the position where you want to add into the file.
In standard C there's no functionality to insert new data at a certain location within a file.
The only two options in plain C are:
There may be OS-specific functions to perform insertion of data at an arbitrary location within a file. But, again, not in the standard C library as defined by the C standard.
steps: