#include <iostream>

int *changeSize(int m[], int basicSize, int desiredSize) {
	int *newArray = new int[desiredSize];
	for (int i = 0; i<basicSize && i<desiredSize; i++) {
		newArray[i] = m[i];
	}
	return newArray;
}

int main()
{
	int i;

	int *m = new int[123];

	m[0] = 12;
	m[1] = 22;
	m[2] = 33;

	std::cout << "m[2] before " << m[2] << std::endl;
	std::cout << "And we can't access elem 220" << std::endl;

	m = changeSize(m, 123, 222);

	m[2] = 99;
	std::cout << "m[2] after " << m[2] << std::endl;

	m[220] = 32;
	std::cout << "And we can access elem 220. Now it is " << m[220] << std::endl;
	std::cin >> i;

    return 0;
}