I am trying to teach myself file I/O by making a address book program where the user can create, edit, and list all of their contacts. The issue I am having is that I want them to be able to delete a contact, i can't use the 'remove()' function because it only takes const char's. The issue is in the second switch statement. Here is my code:
no remove isn't my own function, it deletes files. look up the syntax for remove for c++. it says it takes const char's. And i tried the the .c_str, and that didn't delete the file. It didn't do anything actually.
EDIT: Okay the .c_str() thing worked its just that the destination was wrong but thank you so much!
Okay it actually doesn't still work and this is getting very frustrating. The remove thing only works if there isn't and variable involved and when i do add in Person.Name it stops working.
I get it now! I was trying to delete the file while it was still in use. Thats why it wasn't deleting thanks so much for helping me out. And sorry that I have been a bit confusing.