arays of pointers?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    TEntity* camera = CreateFPSCamera(0,15,1,0);

    TEntity* cubes[10][10];
    for (s32 a = 0 ; a< 10; a++)
    {
        for (s32 b=0; b<10 ;b++ )
        {
           cubes[a,b] =CreateCube(0);
           cubes[a,b]->PositionEntity(a*10,b*10);


        }

    }


this code is supposed to store a pointer to the cube in my array but gives the error:
main.cpp|20|error: incompatible types in assignment of ‘b3d::TEntity*’ to ‘b3d::TEntity* [10]’|

tentity*[10]???

Is it not possible to store pointers in arrays?


Last edited on
 
cubes[a,b]


is not correct... it is legal syntax, but it does not do what you think it does.

You want

 
cubes[a][b] = ...;

ahh

tx
Topic archived. No new replies allowed.