c++ - Why could a function works fine in main() but not inside a class? -
i have move function call main class constructor. while function works fine in main, when moved class constructor generates error on compile time:
cannot convert 'tile**' 'tile*' argument '1' 'bool set_tiles(tile*)' in function 'void moveobjects(tile**)'
i don't understand how happen since both functions called identiacally. main() , class constructor:
int main(){ tile *tiles[ total_tiles ]; if( set_tiles( tiles ) == false ) return 1; // setear los tiles currentstate = new overworld(); update_game(tiles); } overworld::overworld() { tile *tiles[ total_tiles ]; if( set_tiles( tiles ) == false ) exit(1); // error } bool set_tiles( tile *tiles[] ){ } void update_game(tile *tiles[]){ moveobjects(tiles); }
also noticed error mentions function, i'm not sure how it's related i'll copy it's code:
what doing wrong?
Comments
Post a Comment