Réponse acceptée !
Bonjour,
Il y a eut un post sur le même sujet hier :
Sujet : [C] incompatibilité dans une fonction [ Divers / Divers ] (The_KniGhT_972)
Ce qui donne cette solution possible :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MATMAXX 10
#define MATMAXY 10
void dispmap(int*,int,int);
typedef struct dot
{
int coordX;
int coordY;
} dot;
typedef struct wall
{
dot begin;
dot end;
} wall;
int main(int argc, char *argv[])
{
int map[MATMAXX][MATMAXY];
memset(map,0,sizeof(map));
dispmap((int*)map,MATMAXX,MATMAXY);
return 0;
}
void dispmap(int *toDisplay,int x,int y)
{
int i,j;
for(i=0 ; i<x ; i++)
{
for(j=0 ; j<y ; j++) printf("%d ",toDisplay[i * y + j]);
printf("\n");
}
}
Jean-François