This repository has been archived on 2019-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
s6-pa-tp/TP6/perror.c
2017-03-27 15:59:08 +02:00

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;
}