29 lines
492 B
C
29 lines
492 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
|
|
void afficherTableau(unsigned short tab[], size_t taille) {
|
|
if (taille == 0) {
|
|
return;
|
|
}
|
|
|
|
if (taille == sizeof(tab) / sizeof(tab[0])) {
|
|
printf("{");
|
|
}
|
|
|
|
printf("%d", tab[0]);
|
|
|
|
if (taille > 1) {
|
|
printf(", ");
|
|
afficherTableau(tab + 1, taille - 1);
|
|
} else {
|
|
printf("}");
|
|
}
|
|
}
|
|
|
|
|
|
int main(void) {
|
|
unsigned short int tab[4] = {1,2,3,4};
|
|
afficherTableau(tab, 4);
|
|
return EXIT_SUCCESS;
|
|
} |