> check if a value exists
Well the simple way is to use a for loop to examine each element of the array, and decide if that is the one you're looking for.
If your array is sorted in some way, then you can use the bsearch() function for greater efficiency.
> if so delete it
You can't actually delete something from an array (in the sence that the array will now take up less memory).
Something quick would be to have a 'validity' flag in the structure, so deleting an element would be
[tt]array[element].deleted = 1;[/tt]
If you don't want these kinds of holes in your array, then you have to move the array about a bit, say
[tt]array[element] = array[last--];[/tt]
Quick, but destroys the sort order if you're using bsearch()
[tt]for(i=element;i<last-1;i++)
array = array[i+1];
last--;[/tt]
Slower, but preserves the sort order for bsearch()
--