Date: Thu, 22 Mar 2001 15:36:54 +0530 (IST) From: Mridul Muralidharan To: danieleliasson AT chello DOT se cc: Djgpp mailing list Subject: Re: Problem with int[][] In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk hi, the error mentioned is reported when u try something like this - int map[GRIDSIZE][GRIDSIZE]; main(){ // A var map which is the one used in this local scope int map; // Rest of code } hence here u have a local variable of different type but same name declared in a local scope. check u'r code buddy :) hope this helped u, Mridul Muralidharan S8 Electronics and Communication Regional Engineering College Calicut India ------------------------------------------------------------------------------ If the code and the comments disagree, then both are probably wrong. -- Norm Schryer All generalizations are false, including this one. -- Mark Twain /earth is 98% full ... please delete anyone you can. - fortune On Thu, 22 Mar 2001, Daniel Eliasson wrote: > I keep getting these messages when I use my array: > > player.cpp:55: invalid types `int[int]' for array subscript > player.cpp:57: invalid types `int[int]' for array subscript > > > The code looks like this: > > for(int i = 0; i < GRIDSIZE; i++) > { > for(int j = 0; j < GRIDSIZE; j++) > { > if(map[i][j] == GRID_PLAYER) // It's complaining about these > { > map[i][j] = GRID_EMPTY; // It's complaining about these > } > } > } > > Does anyone know what's wrong? I define map like this: > int map[GRIDSIZE][GRIDSIZE]; > > (GRIDSIZE is a const int with the value of 128 (const int GRIDSIZE = 128;)) > > Thanks in advance, > Daniel Eliasson > >