#include using namespace std; #define MAKEVAR(type, name) \ private: \ type name; \ public: \ type get_##name() {return name;} \ void set_##name(type o) {name = o;} class Circle { // make some variables automatically! MAKEVAR(int, x) MAKEVAR(int, y) MAKEVAR(double, radius) }; int main() { Circle c; c.set_x(10); c.set_y(5); c.set_radius(7.5); cout << c.get_x() << ", " << c.get_y() << " " << c.get_radius() << endl; return 0; }