for some reason, i can't figure out how to pass an array into a function properly.
here's the code where i'm encountering the error:
function declaration:
function body:Code:void initMapBuffer(map map1, CHAR_INFO &mapBuffer[]);
the map struct:Code:void initMapBuffer(map map1, CHAR_INFO &mapBuffer[]) { for (int y = 0; y < map1.max.Y; y++) { for (int x = 0; x < map1.max.X; x++) { mapBuffer[x + y * MAP_BUFFER_W].Char.AsciiChar = map1.tiles[x][y].symbol; } } }
the tile structCode:struct map { tile tiles[MAP_MAX_X][MAP_MAX_Y]; COORD max; };
Code:struct tile { char symbol; char foreground, background; };
please answer this question. I usually can figure these things out myself, but i'm stumped on this one. This piece of code is the cornerstone for my RPG, without it, i can't load maps and display them to the screen.



LinkBack URL
About LinkBacks


