Advertisement

Another error

Started by July 24, 2000 08:46 AM
2 comments, last by cohen1 24 years, 5 months ago
Ok, I took of the ''*'' of the three stament but now I get this error: error C2446: ''=='' : no conversion from ''const int'' to ''char (*)[10]''
Here is what the code should look like:

        #include <iostream.h>void main(){				unsigned char map[10][10]=	{	{1,1,1,1,1,1,1,1,1,2},		{1,0,0,0,0,0,0,0,1,2},		{1,0,0,0,0,0,0,0,1,2},		{1,0,0,0,0,0,0,0,1,2},		{1,0,0,0,0,0,0,0,1,2},		{1,0,0,0,0,0,0,0,1,2},		{1,0,0,0,0,0,0,0,1,2},		{1,0,0,0,0,0,0,0,1,2},		{1,0,0,0,0,0,0,0,1,2},		{1,1,1,1,1,1,1,1,1,2}         };	for (int scx=0; scx<10; scx++)        {		for (int scy=0; scy<10; scy++)		{			if (map[scy][scx] == 0)				cout << " ";			if (map[scy][scx] == 1)				cout << "1";			if (map[scy][scx] == 2)				cout << endl;		}         }}        


This should work fine!

-------------------------------
That's just my 200 bucks' worth!

..-=gLaDiAtOr=-..

Edited by - Gladiator on July 24, 2000 12:54:33 PM
Advertisement
quote: Original post by Gladiator

if (map[scx][scy] == 0)


you probably want to have it be map[scy][scx] too, to get your desired coordinates. But that all depends on your mapping preference.

Lep
The code is only good if you use it w/ map[scx][scy]. Think why...

"Everything is relative." -- Even in the world of computers.
everything is relative. -- even in the world of computers... so PUSH BEYOND THE LIMITS OF SANITY!

This topic is closed to new replies.

Advertisement