I'm writing a code that can add a name to a list of pre-existing names or remove a name from the same list. Everything works fine except when I try to add a name. This is the function that I'm using to add a name:
The delete function works perfectly, but for some reason when I try to make addNew[i]=holder[i], addNew doesn't change at all and addNew[size] says that it contains a bad pointer. Am I doing something wrong? Because it looks like it would work to me. I tried creating a new project and pasting it to see if that was what was wrong, but still nothing. Any help?
I can't believe I didn't realize that . . .
I've been messing with this for the past four hours and never remembered that index starts at 0, so the last element would be size-1. Fail.
Thanks you very much for your help