I am suppose to
"Create a program to read an array of characters from the keyboard terminated by EOF. Count the number of characters that are entered. The characters should be stored into an array of integers. Display the array of characters as characters. Call shellsort (pp 62) to sort the array and display the sorted array."
Here is the thing I almost have it all done but I am trying to print out the letters for each character it stores in the array and then sort the array and display it. The problem is that I just tested the while loop without the shellsort program and it will not show the letters I store in the array.
Am I just not thinking my logic is correct or am I naming a variable wrong?
Also am I using the wrong names for the variables in the shellsort? I am getting a "error: expected expression before ‚int‚" and a " error: too few arguments to function ‚shellsort‚"
Here is my code I hope someone can point me in the right direction im so confused.
void shellsort(int v, int n);
int i, c, n;
while ((c = getchar()) != EOF)
num[i++] = c;
for (i=c; i != EOF; i++)
shellsort(int v[i], int n);
void shellsort(int v, int n)
int gap, i, j, temp;
for (gap = n/2; gap > 0; gap /= 2)
for (i = gap; i < n; i++)
for (j=i-gap; j>=0 && v[j]>v[j+gap]; j-=gap)
temp = v[j];
v[j] = v[j+gap];
v[j+gap] = temp;