#include <iostream>

using namespace std;

struct foo {
	int x;
	int* y;
	foo(int _x, int _y) : x{_x} {
		y = new int(_y);
	}
};

void print(int step, foo& v) {
	cout << step << ". x = " << v.x << " ; y = " << *(v.y) << endl;
}

void modify(int step, foo v) {
	v.x = 3;
	*(v.y) = 4;
	print(step, v);
}

int main() {
	foo v(1, 2);
	print(1, v);
	modify(2, v);
	print(3, v);
	return 0;
}