1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| #include <stdio.h>
#define tab_from_char(c) Tab##c
static const int TabA[7][5] = {{0,1,1,1,0},
{1,0,0,0,1},
{1,0,0,0,1},
{1,1,1,1,1},
{1,0,0,0,1},
{1,0,0,0,1},
{1,0,0,0,1}};
static const int TabZ[7][5] = {{1,1,1,1,1},
{0,0,0,0,1},
{0,0,0,1,0},
{0,0,1,0,0},
{0,1,0,0,0},
{1,0,0,0,0},
{1,1,1,1,1}};
int *PointeurTableau(char MyChar)
{
switch(MyChar)
{
case 'A':
return *tab_from_char (A);
break;
case 'Z':
return *tab_from_char (Z);
break;
}
}
int main(void)
{
int i;
int j;
int *tab
tab = PointeurTableau('A');
for (i = 0; i < 7; i++)
{
for (j = 0; j < 5; j++)
{
printf ("%d", (*tab)[i][j]);
}
printf ("\n");
}
return 0;
} |
Partager