Michael P. Wrote:

> Okay, I'm getting an array bounds error, and I have no clue why. Here is the 
> code that affect it:
> 
> //Constants
> const int SCREEN_WIDTH = 640;
> const int SCREEN_HEIGHT = 480;
> const int TILE_WIDTH = 20;
> const int TILE_HEIGHT = 20; //how big one tile is, in pixels
> const int NUMBER_OF_TILES_WIDTH = SCREEN_WIDTH / TILE_WIDTH;
> const int NUMBER_OF_TILES_HEIGHT = SCREEN_HEIGHT / TILE_HEIGHT;
> const int TYPES_OF_TILES = 4;
> 
> //variables
> char[ NUMBER_OF_TILES_WIDTH ][ NUMBER_OF_TILES_HEIGHT ] tiles;
> //set all tiles to random
> for ( int i = 0; i < NUMBER_OF_TILES_WIDTH; i++ )
> {
>       for ( int j = 0; j < NUMBER_OF_TILES_HEIGHT; j++ )
>       {
>               tiles[ i ][ j ] = cast( char )( rand() & TYPES_OF_TILES ); 
> //occurs here
>       }
> }
> 
> So, I'm not really sure why it's happening.... Anyone mind shedding some 
> light on why?
> 
> -Michael P.

I meant array bounds error, not array bounds array. :P

Reply via email to