fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Plansza
  5. {
  6. public:
  7. char tablica[25][70];
  8.  
  9. void rysuj() const
  10. {
  11. for(int i = 0; i < 25;i++)
  12. {
  13. for(int j = 0; j < 70;j++)
  14. {
  15. tablica[i][j] = 0;
  16. }
  17. }
  18.  
  19. int i = 0,j = 0;
  20. for(int j = 0; j < 70; j++)
  21. {
  22. tablica[i][j] = (char) 219;
  23. }
  24.  
  25. for(int i = 1 ;i < 25; i++)
  26. {
  27. tablica[i][0] = (char) 219;
  28. tablica[i][69] = (char) 219;
  29. }
  30.  
  31. for(j = 0; j < 70; j++)
  32. {
  33. i = 24;
  34. tablica[i][j] = (char) 219;
  35. }
  36. for(int i = 0;i < 25;i++)
  37. {
  38. for(int j = 0; j < 70;j++)
  39. {
  40. cout << tablica[i][j] ;
  41. }
  42. cout << endl;
  43. }
  44. }
  45. };
  46.  
  47. int main()
  48. {
  49. Plansza mapa;
  50. mapa.rysuj();
  51. return 0;
  52. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function 'void Plansza::rysuj() const':
prog.cpp:15:31: error: assignment of read-only location '((const Plansza*)this)->Plansza::tablica[i][j]'
                 tablica[i][j] = 0;
                               ^
prog.cpp:22:28: error: assignment of read-only location '((const Plansza*)this)->Plansza::tablica[i][j]'
              tablica[i][j] = (char) 219;
                            ^
prog.cpp:27:27: error: assignment of read-only location '((const Plansza*)this)->Plansza::tablica[i][0]'
             tablica[i][0] = (char) 219;
                           ^
prog.cpp:28:28: error: assignment of read-only location '((const Plansza*)this)->Plansza::tablica[i][69]'
             tablica[i][69] = (char) 219;
                            ^
prog.cpp:34:27: error: assignment of read-only location '((const Plansza*)this)->Plansza::tablica[i][j]'
             tablica[i][j] = (char) 219;
                           ^
stdout
Standard output is empty