I’m working on a project and I’m in doubt which one of
FILE *ptr_file;
ptr_file = fopen("input.txt", "ab+");
or
FILE *ptr_file;
ptr_file = fopen("input.txt", "wb+");
fits the requirements better.
If the file does not exist already, it is created; otherwise, its content is deleted. New records entered by the user are always appended to existing records; however, the user can also modify existing records in the file.
No further explanation is offered and I am hoping someone more experienced can explain which mode to use for opening the said file to use in further methods. I tried to include as much info as possible yet as to not cheat.