so could anyone try to pinpoint what's wrong with the following?
- Code: Select all
#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 10 //preprocessor constant used to define array size
void inparray(int *array)
/*function to input elements in array*/
{
int i;
for (i=0;(i!=MAXSIZE);i++)
{
printf("Please enter the element number %d ",i+1);
scanf("%d",array[i]); //program crashes here
printf("\n\n");
}
}
int main()
{
int array[MAXSIZE]={0,0,0,0,0,0,0,0,0,0};
inparray(array);
}
anyone's got an idea why it crashes on input?
ps. euh displaying the array in another function works on the other hand.
d'apres role li pas p ecrire au bon endroit ca selon moi... mais bon :/