Code:
 The are many different ways to  sort data. For some applications, e.g.,  making movies, it is better to sort   pointers to the data, rather than sort the  data itself. You must write a program to demonstrate this kind of activity. The program must ... 

  • Define data types for ... (0.2%)
    • A pointer to an integer
    • An array of five integers
    • An array of five pointers to integers
  • Have an intialization function that ... (0.3%)
    • Initializes the elements of an array of five integers to random integers. Use rand to generate the random integers, using srand with the return from getpid to seed the random number generation.
    • Initializes the elements of an array of five pointers to integers to point to the corresponding elements of the array of integers. (The structure is anaolgous to the one created in this example that we discussed in class.)
  • Have a function that prints an array of five integers. (0.2%)
  • Have a function that prints the integers pointed to by an array of five pointers to integers. (0.3%)
  • Have a function that uses a bubble-sort to sort an array of five integers, in ascending order of the integers. (0.4%)
    • And to make it fun, this function may not contain any [ or ] characters. (You may want to implement it with []s first, and then work out how to remove them later :-).
  • Have a function that uses a bubble-sort to sort an array of five pointers to integers, in ascending order of the integers pointed to by the pointers (i.e., do not sort the integer array - sort the array of pointers so that when you print it, the integers come out in ascending order). (0.4%)
  • Have a main function that ... (0.2%)
    • Declares an array of five integers and an array of five pointers to integers.
    • Initializes the arrays (as described above).
    • Prints the array of integers.
    • Sorts the array of pointers (as described above).
    • Prints the integers pointed to by the array of pointers.
    • Sorts the array of integers.
    • Prints the array of integers.
    • Prints the integers pointed to by the array of pointers.
The output from a sample run should look like this. The picture on the right shows the array of integers and array of pointers after intialization, sorting the array of pointers, and sorting the array of integers. http://web.cs.miami.edu/home/gallo/C...nterArrays.gif ---- Initialized array of integers ---- 0 : 958486403 1 : 1006139074 2 : 893180240 3 : 769601150 4 : 392522169 ---- Sorted array of pointers ---- 0 : 392522169 1 : 769601150 2 : 893180240 3 : 958486403 4 : 1006139074 ---- Sorted array of integers ---- 0 : 392522169 1 : 769601150 2 : 893180240 3 : 958486403 4 : 1006139074 ---- Array of pointers ---- 0 : 1006139074 1 : 958486403 2 : 893180240 3 : 392522169 4 : 769601150
This is the assignment

Code:
     1    //-----------------------------------------------------------------------------
     2    #include <stdio.h>
     3    #include <stdlib.h>
     4    
     5    #define TRUE 1
     6    #define FALSE 0
     7    const int ARRAYSIZE = 5;
     8    
     9    typedef int *IntPointer;
    10    
    11    typedef int IntArray[];
    12    
    13    typedef int *PointerArray[];
    14    
    15    //-----------------------------------------------------------------------------
    16    
    17    void initArray(IntArray array,PointerArray pointer) {
    18    
    19    int index;
    20    srand(getpid());
    21    for (index = 0;index < ARRAYSIZE;index++){
    22    array[index] = (int)rand();
    23    }
    24    
    25    for (index = 0;index < ARRAYSIZE;index++){
    26    pointer[index] = &array[index];
    27    }
    28    }
    29    //-----------------------------------------------------------------------------
    30    
    31    void printArray(IntArray array){
    32        int index;
    33        for (index = 0;index < ARRAYSIZE;index++) {
    34            printf("%d : %10d\n",index,array[index]);
    35    
    36        }
    37        printf("\n");
    38    }
    39    //-----------------------------------------------------------------------------
    40    
    41    void printArrayPointers(PointerArray pointer){
    42        int index;
    43        for (index = 0;index < ARRAYSIZE;index++) {
    44            printf("%d : %10d\n",index,*pointer[index]);
    45        }
    46        printf("\n");
    47    }
    48    //-----------------------------------------------------------------------------
    49    void bubbleSortArray(IntArray array){
    50      int a, b, temp;
    51     
    52      for (a = (ARRAYSIZE - 1); a > 0; a--)
    53      {
    54        for (b = 1; b <= a; b++)
    55        {
    56          if ((*array+(b-1)) > (*array+b))
    57          {
    58            temp = (*array+(b-1));
    59            *(array+(b-1)) = *(array+b);
    60            *(array+b) = temp;
    61          }
    62        }
    63      }
    64    }
    65    //-----------------------------------------------------------------------------
    66    void bubbleSortPointer(PointerArray pointer){
    67        int a, b;
    68        IntPointer temp;
    69     
    70      for (a = (ARRAYSIZE - 1); a > 0; a--)
    71      {
    72        for (b = 1; b <= a; b++)
    73        {
    74          if (*(pointer+(b-1)) > *(pointer+b))
    75          {
    76            temp = *(pointer+(b-1));
    77            *(pointer+(b-1)) = *(pointer+b);
    78            *(pointer+b) = temp;
    79          }
    80        }
    81      }
    82    }
    83    
    84    //-----------------------------------------------------------------------------
    85    int main(void) {
    86    IntArray array[ARRAYSIZE];
    87    PointerArray pointer[ARRAYSIZE];
    88    
    89    
    90    InitArray(array,pointer);
    91    printArray(array);
    92    bubbleSortPointers(pointer);
    93    printArrayPointers(pointer);
    94    bubbleSortArray(array);
    95    printArray(array);
    96    printArrayPointers(pointer);
    97    
    98    
    99        return(EXIT_SUCCESS);
   100    }
   101  //-----------------------------------------------------------------------------
Here's the problem:

ArraysAndPointers.c: In function ‘main’:
ArraysAndPointers.c:86: error: array type has incomplete element type
ArraysAndPointers.c:87: error: array type has incomplete element type

Can you help me figure out what's wrong?