25 lines
378 B
C
25 lines
378 B
C
|
/*Amelie Lambert pour ensiie*/
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
#define SIZE 42
|
||
|
|
||
|
int main (void)
|
||
|
{
|
||
|
int *tab;
|
||
|
int i;
|
||
|
|
||
|
tab = malloc (SIZE * sizeof(int));
|
||
|
|
||
|
// L'instruction suivante était une assignation
|
||
|
if (tab == NULL) {
|
||
|
perror ("malloc()");
|
||
|
exit (-1);
|
||
|
}
|
||
|
|
||
|
for (i = 0; i < SIZE; i++)
|
||
|
tab[i] = random();
|
||
|
|
||
|
return 0;
|
||
|
}
|