Hi everyone, im programing an agenda in c++ but im having a little trouble erasing an entry. Sorry the code is long, i was too lazy to use call functions... anyways bear with me.
i tried setting the value to NULL on the entry i want to erase but that doesnt work, someone told me to change it to "0", but that doesnt work either. any advice please?.
the code was too long so i had to upload the cpp file mediafire
Why not cut it down to the new statement and the delete statement with anything relevant in between? That would be easy for us to read and help you with.
Without knowing how cla[x] nom[x] and num[x] were allocated, it's impossible to say what the correct thing to do on lines 72-74 is.
Generally when you 'erase' something from an array you do so by shifting the elements past the one you're erasing to the left, and updating any variable indicating the number of stored elements in the array.
Use pastebin or ideone or something similar in lieu of mediafire if you must. Better is to reduce the code to something small that still exhibits the same problem and post with that.