Okay, let's take this from the top
void shellSort(int *array, int array_size)
{
Your code completely omitted the needed gaps array
const int gaps[] = {701, 301, 132, 57, 23, 10, 4, 1};
int e, i, j, temp;
The outer loop needs to be across gaps rather than 0 to array_size
for(e = 0; e < sizeof(gaps)/sizeof(int); ++e)
{
int gap = gaps[e];
You need to use the gap from the gaps array in the inner loop
for( i = gap; i < array_size; ++i)
{
temp = array[i];
for( j = i; j >= gap && array[j - gap] > temp; j -= gap)
{
array[j] = array[j-gap];
}
You need to store temp back into the array
array[j] = temp;
}
}
}
NB: I don't have a compiler to hand right now, so I haven't checked that, but I think it's right.
Also, a few minor points, this:
int e, i, j, temp;
is bad practice, instead declare each variable as you use it, i.e. do this instead:
for( int i = gap; i < array_size; ++i)
{
int temp = array[i];