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.
s4-c/P84.c

24 lines
375 B
C

/* Allocations dynamiques */
#include <stdlib.h>
#include <stdio.h>
void init(int *tab, int n) {
int i;
for (i = 0; i < n; i++) {
tab[i] = i;
printf("tab[%d]=%d\n", i, tab[i]);
}
}
int main() {
int i, n, *tab;
printf("Saisissez n : ");
scanf("%d", &n);
tab = (int *) malloc(n * sizeof(int));
init(tab, n);
return 0;
}