程序博客网 > mac 魔兽争霸3 联网
来源:互联网 发布:mac 魔兽争霸3 联网 编辑:程序博客网 时间:2024/06/05 09:59
#ifndef IntCell_H#define IntCell_Hclass IntCell{public:explicit IntCell(int initialValue = 0);int read() const;void write(int x);private:int storedValue; };#endif #include <iostream>#include "IntCell.hpp"using namespace std;IntCell::IntCell(int initialValue):storedValue(initialValue){}int IntCell::read() const{return storedValue;}void IntCell::write(int x){storedValue = x;}/*int main(){IntCell m;m.write(5);cout << "Cell contents: " << m.read() << endl;return 0;}* */