Dude (./21) :
Le code (tableaux dynamiques style JAVA -si j'ai bien compris-) :#define LIGNES 3
#define COLONNES 4
#define USE_TI89
#define USE_TI89TI
#define USE_TI92PLUS
#define USE_V200
#define NOSTUB
#include <std.h>
void afftab( unsigned char **matrice)
{
unsigned char x = 0, y = 0;
while ( y++ < LIGNES) {
while ( x++ < LIGNES) {
printf("%u\n%u * %u",matrice[y][x],y,x);
ngetchx();
clrscr();
}
x = 0;
}
return ;
}
void __main(void )
{
unsigned char **matrice;
unsigned char x = 0, y = 0;
int i;
LCD_BUFFER svscr;
LCD_save(svscr);
clrscr();
// --- Alloc ---
matrice = malloc(sizeof *matrice * LIGNES);
if ( matrice != NULL)
{
// --- Alloc(Suite) ---
for ( i = 0; i++ < LIGNES ; )
{
matrice[i] = malloc(sizeof **matrice * COLONNES);
}
// --- Remplissage ---
while ( y++ < LIGNES) {
while ( x++ < LIGNES) {
matrice[y][x] = x);
}
x = 0;
}
// ---Affichage---
afftab(matrice);
// ---Cleanup---
for ( i = 0; i++ < LIGNES ; )
{
free(matrice[i]);
}
free(matrice);
}
LCD_restore(svscr);
}
Voilà, donc : qu'est-ce qui va pas ?
À cause des tests dans tes boucles for et while, tu vas commencer à allouer, afficher ou effacer à partir de l'indice 1 et non pas de l'indice 0 (il faudrait écrire "for (i = 0; i < N; i++)" ou mieux : "for (i = N; i--; )")