failure during conversion to COFF

Can someone help me out please it's not letting me compile my code.

what code?
#include <iostream>
#include <string>
#include <fstream>
#include "windows.h"

using namespace std;

char Board[6][12]= {"#############",
"# # # #",
"#############",
"# # # #",
"#############",
"# @ # # #",
"#############"};

int Gamespeed = 100;
bool stopgame = false;

int main ()
{
while (stopgames == false)
{
system ("cls");
for (int y = 0; y < 6; y++)
{
cout << Board[y];
}
for (int y = 0; y < 6; y++)
{
for (int x = 0; x < 12 ; x++)

switch (Board[y][x])
{
case '#':
{
Board[y][x] = 219;
}
case '@':
{
if (GetAsyncKeyState(VK_UP) !=0)
{
int y2 = (y-1);

switch (Board [y2][x])
{
case ' ':
{
Board [y][x] = ' ';
y-=2;
Board [y2][x] = '@';
}break;

}
}

if (GetAsyncKeyState(VK_DOWN) !=0)
{
int y2 = (y + 1);
switch(Board[y2][x])
{
case ' ':
{
board [y][x] = ' ';
y += 2;
Board [y2][x] = '@';
}break;
}
}
if (GetAsyncKeyState(VK_RIGHT) !=0)
{
int x2 = (x + 1);
switch (Board [y][x2])
{
case: ' '
{
Board[y][x] = ' ';
x += 3;
Board[y][x2] = '@';
}

}break;
}
if (GetAsyncKeyState(VK_LEFT) !=0)
{
int x2 = (x - 1);
switch (Board [y][x2])
{
case: ' '
{
Board[y][x] = ' ';
x -= 3;
Board[y][x2] = '@';
}

}break;
}

}break;
}
}
Sleep (Gamespeed);
}
return 0;
}
That code doesn't compile.

Lines 8,10,12,14: You're trying to store 14 characters into an array declared as [12]. Your quoted literal is 13 bytes and you have not alllowed for the trailing \0.

Line 21: stopgame is misspelled.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Last edited on
Topic archived. No new replies allowed.