1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
struct Window { char *view; int width; int height; void init() { view = new char[width * height]; for (int i = 0; i < width * height; i++) { view[i] = 0; } } char pos(size_t x, size_t y) { return view[x + y * width]; } };