#include <iostream>

int main() {
	int t[] = {0,1,2,3,4};

	//int length = sizeof(t) / sizeof(t[0]);
	int length2 = std::size(t);

	//std::cout << "Length: " << length2 << std::endl;



	int tomb[5]; //egy pointer ami a nulladik elemre mutat
	//*p -> p altal mutatott memoriahelyen levo ertek
	//pointer aritmetika: *(ptr+2) = 5 | tomb masodik eleme legyen 5
	//stack es heap | heap -> dinamikusan valtozok helye (?)
	//dinamukus allokacio : malloc, new
	int* pointer = (int*)malloc(5 * sizeof(int)); //5 int hely foglalasa
	free(pointer); //dinamikus memoriat fel kell szabaditani | free(*)-vel

	std::cout << tomb << std::endl;



	int max = 100;
	int min = 0;
	int range = max - min + 1;
	int random = rand() % range + min;

	int* array = new int[10];
	int length3 = sizeof(array);
	std::cout << length3 << std::endl;


	for (int i = 0; i < length3; i++) {
		array[i] = random;
		std::cout<< i << ". " << array[i] << std::endl;
		random = rand() % range + min;
	}

	free(array);


	return 0;
}