c++ pointer
#include <iostream>
void pointers_with_dynamic_memory() {
int arr_size; // arr_size can contain an integer
int* x; // x can contain the memory address of an integer.
std::cout << "enter an integer > 0: ";
std::cin >> arr_size;
// value of x is the starting address of a heap-allocated block ints
x = new int[arr_size];
x[0] = 10; // set first element of array to 10
*x = 50; // set first element of array to 50
*(x + 1) = 100; // +1 offsets automatically by the value of sizeof(int)
delete [] x;
}