I saw an older post on here asking how to do relatively the same thing, but their approach was different and I don't believe their issue was resolved.
I am attempting to write a program that accepts characters into a 10 character length array. I want the program to evaluate the first array position and delete any duplicates it finds later in the array by identifying a duplicate and moving all of the values to the right of it to the left by one. The 'size' of the array is then decreased by one.
I believe the logic I used for the delete function is correct but the program only prints an 'a' for the first value and the fourth value in the array.
Any help would be greatly appreciated, here is my code:
See your line no 58 you had written array[loc]=target;
which is wrong. you need to initialize target
so, target = array[loc];
This will solve your problem.