• Advertisement

Archived

This topic is now archived and is closed to further replies.

Another error

This topic is 6389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]''

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
The code is only good if you use it w/ map[scx][scy]. Think why...

"Everything is relative." -- Even in the world of computers.

Share this post


Link to post
Share on other sites

  • Advertisement