segmentation fault while trying to write a function to sum elements of an array : <p>I've been stuck on this one problem for a while and I'm not sure how I should proceed with this. </p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
int ItSum(int *array, int array_size);

int main(){
    int array_size, isum, sum;
    printf("\nPlease enter the size of the array:");
    scanf("%d",&amp;array_size);
    int *array;
    array=(int*)malloc(array_size*sizeof(int));
    printf("Please enter the elements of the array:");
    int i;
    for(i=0; i&lt;array_size;i++)
        scanf("%d",&amp;array[i]);
    printf("\nThe elements of the array are:");
    for(i=0; i&lt;array_size; i++)
        printf(" %d", array[i]);

    isum=ItSum(*array,array_size);
    printf("\nThe sum of the elements using iteration is:%d", isum);

    free (array);
    return 0;
}

int ItSum(int *array, int array_size){
    int x, itsum;
    itsum=0;    
    for (x=0;x&lt;array_size;x++)
        itsum+=array[x];
    return itsum;
}
</code></pre>

<p>So here's my code so far, and the assignment is to write an iterative and a recursive function that adds five positive integers under 20 together (the inputs that the prof wants us to test have a bunch of negatives and integers above 20). However, when I try and run what I have so far I get a segmentation fault after inputting the elements of the array. I'm not exactly sure what exactly is going wrong here, so any hints or clues would be much appreciated. Thanks. </p>
