Programmation Avancée en C


print_sizeof_tab.c

00001 #include <stdio.h>
00002 #define TAILLE 4
00003 
00004 void print_sizeof_tab(int tab[], int nb_elem) {
00005     printf("Dans print_sizeof_tab, sizeof(tab) = %lu\n", sizeof(tab) );
00006 }
00007 
00008 int main() 
00009 {
00010     int t[TAILLE] = {1, 2, 3, 4};
00011     printf("Dans main, sizeof(t) = %lu\n", sizeof(t));
00012     print_sizeof_tab(t, TAILLE);
00013     return 0;
00014 }
00015