fork download
  1. #include <iostream>
  2. using namespace std;
  3. void draw()
  4. {
  5. int i,j;
  6. cout<<endl;
  7. for(int k=0;k<8;++k)
  8. cout<<" -";
  9. for(i=0;i<8;++i)
  10. {
  11. cout<<endl;
  12. for(j=0;j<8;++j)
  13. {
  14. cout<<"|";
  15. if(board[i][j]==2)
  16. cout<<'Q';
  17. else
  18. cout<<" ";
  19.  
  20. }
  21. cout<<"|"<<endl;
  22. for(int k=0;k<8;++k)
  23. cout<<" -";
  24.  
  25. }
  26. }
  27. int main() {
  28. draw();
  29. return 0;
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void draw()’:
prog.cpp:15:16: error: ‘board’ was not declared in this scope
             if(board[i][j]==2)
                ^
stdout
Standard output is empty