The only way to really "delete" an element from an array is to shift the array down over the removed element. Something like:
Code:
#include <stdio.h>
#include <string.h>
int main() {
int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int size = 10; // number of elements
for (int i = 0; i < size; i++) printf("%d ", a[i]);
putchar('\n');
// remove element at offset 2:
int elem_to_remove = 2;
if (elem_to_remove < size - 1)
memmove(&a[elem_to_remove], &a[elem_to_remove+1],
sizeof a[0] * (size - elem_to_remove));
size--;
for (int i = 0; i < size; i++) printf("%d ", a[i]);
putchar('\n');
return 0;
}
Alternatively, you can "mark" an element as deleted and write logic to essentially ignore that element when printing, searching, and (possibly) writing to a file.
EDIT: Now that I think about it, moving the elements would make your "recNum" values wrong, although I really don't see what their purpose is in the first place. What's the point of storing the array position in the elements?