operand types are incompatible ("char" and "const char *")
You should use the standard C++ string class. C-style strings are awkward, low level, and easy to get wrong (as evidenced by this thread). However, let's look at the problems in your original code, and ignore all of the wrong advice you've been given up to this point.
This is wrong:
char* arrayMap[5225];
...
mapReader >> arrayMap[i];
Why is it wrong? Because arrayMap[i] doesn't point to memory that you own; you're extremely likely to get a memory access violation at runtime. Memory must be allocated first, but doing that would be awkward, low level, and easy to get wrong (as evidenced by this thread). Yes, I'm intentionally repeating myself.
This is wrong too:
if (arrayMap[i] == "X")
The equality operator doesn't work the way you think it does at a lower level. arrayMap[i] is a pointer, and "X" evaluates to a pointer. Unless the planets align and you get a perfect storm of shared string literals in the compiler implementation and arrayMap[i] was conveniently initialized to "X", this test will always fail.
To compare C-style strings you must compare all characters up to a null character ('\0'). The simplest way to do that is by calling the std::strcmp() function:
if (std::strcmp(arrayMap[i], "X") == 0)
Or, since these are single character tests, you can just look at the first character:
if (arrayMap[i][0] == 'X')
But you can greatly simplify things by using C++ strings instead. One simple change will fix all of your string handling problems in that function:
string arrayMap[5225];
Now that that's taken care of, you really need to remember the difference between the = operator and the == operator. The former is assignment and the latter is comparison. You're mixing and matching them, and it's going to bork up your code big time.
I'd probably make a few assumptions and fix your code like so:
void drawMap(string MapLoc)
{
string arrayMap[5225];
int x = 0, y = 0;
int n = 0;
{
ifstream mapReader(MapLoc);
while (n < 5225)
{
if (!(mapReader >> arrayMap[n++]))
break;
}
}
for (int i = 0; i < n; i++)
{
if ((i == 96) || (i == 191) || (i == 286) || (i == 381) || (i == 476) || (i == 571) || (i == 666) || (i == 761) ||
(i == 856) || (i == 951) || (i == 1046) || (i == 1141) ||(i == 1236) || (i == 1331) || (i == 1426) || (i == 1521) ||
(i == 1616) || (i == 1711) || (i == 1806) || (i == 1901) || (i == 1996) || (i == 2091) || (i == 2186) || (i == 2281) ||
(i == 2376) || (i == 2471) || (i == 2566) || (i == 2661) || (i == 2756) || (i == 2851) || (i == 2946) || (i == 3041) ||
(i == 3136) || (i == 3231) || (i == 3326) || (i == 3421) || (i == 3516) || (i == 3611) || (i == 3706) || (i == 3801) ||
(i == 3896) || (i == 3991) || (i == 4086) || (i == 4181) || (i == 4276) || (i == 4371) || (i == 4466) || (i == 4561) ||
(i == 4656) || (i == 4751) || (i == 4846) || (i == 4941) || (i == 5036) || (i == 5131))
{
y++;
}
if (arrayMap[i] == "X")
{
// Draw Wall
glColor4ub(255, 255, 255, 255);
glBegin(GL_QUADS);
glVertex2f(10 * x, 10 * y);
glVertex2f(10 * x, 10 * y);
glVertex2f(10 * x, 10 * y);
glVertex2f(10 * x, 10 * y);
glEnd();
}
else if (arrayMap[i] == ".")
{
// Draw Space
glColor4ub(0, 0, 0, 255);
glBegin(GL_QUADS);
glVertex2f(10 * x, 10 * y);
glVertex2f(10 * x, 10 * y);
glVertex2f(10 * x, 10 * y);
glVertex2f(10 * x, 10 * y);
glEnd();
}
else if (arrayMap[i] == "C")
{
// Draw Char
}
else if (arrayMap[i] == "O")
{
// Draw Opponent
}
}
}
One of the assumptions is that the algorithm in general is correct and what you want.