I'm trying to "delete" an element from my struct and move the rest of my arrays below it up so it doesn't show a gap.
I can't, unfortunately, paste the code that I am using here. My teacher will be checking for plagiarism, so I really don't want to bother explaining that this is my own written code and risk my grade. I'll just try to explain the code instead.
I've got a code to call a function so I can find the position of the bank account that I wish to delete, which includes ID, first & last name, and balance.
This function also returns an integer, which I have named it c.
In my for loop (j = c; j < totalAccs; j++)
I have included all of my arrays and int variables(from my struct), and by using strcpy I replace the element c ( the one that I found from calling another function). i.e. strcpy(a[j].id,a[j+1].id)
.
I'm pretty sure that it's my loop that is completely wrong, but I am not sure what else to type in there.
My current problem is that whenever I execute this loop it replaces those arrays that I want to replace but it also types out a 0 at the end of my list.