Otóż wszystko mi śmiga póki nie dodaję tablicy string h do pętli for i dalszej części kodu:
#include <cstdlib>
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
string a[8];
string b[8];
string c[8];
string d[8];
string e[8];
string f[8];
string g[8];
string h[8];
for(int j=1; j<9; j++)
{
a[j]='O';
b[j]=' ';
c[j]=' ';
d[j]=' ';
e[j]=' ';
f[j]=' ';
g[j]=' ';
h[j]='X';
}
cout<<"++===++===+===+===+===+===+===+===+===++===================++"<<endl;
cout<<"|| h || "<<h[1]<<" | "<<h[2]<<" | "<<h[3]<<" | "<<h[4]<<" | "<<h[5]<<" | "<<h[6]<<" | "<<h[7]<<" | "<<h[8]<<" || Biala druzyna: O ||"<<endl;
cout<<"++===++---+---+---+---+---+---+---+---++===================++"<<endl;
cout<<"|| g || "<<g[1]<<" | "<<g[2]<<" | "<<g[3]<<" | "<<g[4]<<" | "<<g[5]<<" | "<<g[6]<<" | "<<g[7]<<" | "<<g[8]<<" || Czarna druzyna: X ||"<<endl;
cout<<"++===++---+---+---+---+---+---+---+---++===================++"<<endl;
cout<<"|| f || "<<f[1]<<" | "<<f[2]<<" | "<<f[3]<<" | "<<f[4]<<" | "<<f[5]<<" | "<<f[6]<<" | "<<f[7]<<" | "<<f[8]<<" || ||"<<endl;
cout<<"++===++---+---+---+---+---+---+---+---++ ||"<<endl;
cout<<"|| e || "<<e[1]<<" | "<<e[2]<<" | "<<e[3]<<" | "<<e[4]<<" | "<<e[5]<<" | "<<e[6]<<" | "<<e[7]<<" | "<<e[8]<<" || ||"<<endl;
cout<<"++===++---+---+---+---+---+---+---+---++ ||"<<endl;
cout<<"|| d || "<<d[1]<<" | "<<d[2]<<" | "<<d[3]<<" | "<<d[4]<<" | "<<d[5]<<" | "<<d[6]<<" | "<<d[7]<<" | "<<d[8]<<" || ||"<<endl;
cout<<"++===++---+---+---+---+---+---+---+---++ ||"<<endl;
cout<<"|| c || "<<c[1]<<" | "<<c[2]<<" | "<<c[3]<<" | "<<c[4]<<" | "<<c[5]<<" | "<<c[6]<<" | "<<c[7]<<" | "<<c[8]<<" || ||"<<endl;
cout<<"++===++---+---+---+---+---+---+---+---++ ||"<<endl;
cout<<"|| b || "<<b[1]<<" | "<<b[2]<<" | "<<b[3]<<" | "<<b[4]<<" | "<<b[5]<<" | "<<b[6]<<" | "<<b[7]<<" | "<<b[8]<<" || ||"<<endl;
cout<<"++===++---+---+---+---+---+---+---+---++ ||"<<endl;
cout<<"|| a || "<<a[1]<<" | "<<a[2]<<" | "<<a[3]<<" | "<<a[4]<<" | "<<a[5]<<" | "<<a[6]<<" | "<<a[7]<<" | "<<a[8]<<" || ||"<<endl;
cout<<"++===++===+===+===+===+===+===+===+===++===================++"<<endl;
cout<<"||XXX|| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ||"<<endl;
cout<<"++===++===+===+===+===+===+===+===+===++"<<endl;
return 0;
}
Po usunięciu h[j] z pętli for oraz tekstu dalej, wszystko działa.