#include #include "libcell.h" Exc::Exc(const char *m) : msg(m) { } Cell::Cell(int init) : val(init) { printf("init %p=%d\n", this, init); } Cell::~Cell() { printf("free %p (was %d)\n", this, val); } void Cell::set(int x) { if ( x < 0 ) throw Exc("< 0"); val = x; } int Cell::get() { return val; } Cell global_cell(3141592);