Date: Thu, 16 Jul 1998 19:19:32 +0300 From: Alexander Bokovoy Reply-To: Alexander Bokovoy Organization: BSPU named after Maxim Tank Message-ID: <13805.980716@bspu.unibel.by> To: djgpp AT delorie DOT com Subject: Re: problem setting my map array References: <01bdb0cf$784be300$b4691ace AT ZZTiger DOT mho DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Hi Joel, 16.07.98, you wrote: > I've declared my map array like this: > int map[MAP_HEIGHT][MAP_WIDTH]; > And I'm trying to write to it like this: > map = > { > 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, > 1,1, > 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, > 1,1, [skipped] > 1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1, > 1,1 > }; > But DJGPP gives me this: > tile.cpp: In method `void Tile_Map::Initialize()': > tile.cpp:14: parse error before `]' > What am I doing wrong? Brief: You're declared two dimensional array but tried to initialize it with one dimensional data. Solution: map = { {1,1,1,1,1,....,1,1}, /* First Line */ {1,1,1,1,1,....,1,1}, /* Second Line */ .... {1,1,1,1,1,....,1,1} /* Last Line */ }; Regards, Alexander Bokovoy, --=== The Soft Age coming soon ===--