fork download
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. class Cell {
  6. private:
  7. bool readOnly;
  8. int value;
  9. public:
  10. Cell(int value, bool readOnly) {
  11. this->value = value;
  12. this->readOnly = readOnly;
  13. }
  14.  
  15. bool isReadOnly() {return readOnly;}
  16. int getValue() const {return value;}
  17. void setValue(int value) {if (!readOnly) this->value = value;}
  18. // ostream& operator << (ostream& out, const Cell &rhs);
  19. };
  20.  
  21. ostream& operator << (ostream &out, const Cell &rhs) {
  22. out << " " << rhs.getValue() << " ";
  23.  
  24. return out;
  25. }
  26.  
  27. void getFilename(char* filename) {
  28. cout << "Enter source file: ";
  29. cin >> filename;
  30. }
  31.  
  32. int main() {
  33. char* filename;
  34. //getFilename(filename);
  35.  
  36. //Board *board = new Board(filename);
  37.  
  38. Cell cell(0, true);
  39. cout << cell << endl;
  40. //delete board;
  41. return 0;
  42. }
  43.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
 0