#include int main(int argc, char** argv) { int* x = new int[10]; for (int i = 0 ; i < 10 ; ++i) { x[i] = i*7; std::cout << "x[" << i << "] = " << x[i] << std::endl; } // this will make y point to x[7] // the same would be true regardless of sizeof(x[0]) int* y = x + 7; std::cout << "y = x + 7 = " << *y << std::endl; // this will make z point to x[5] int* z = y - 2; std::cout << "z = y - 2 = " << *z << std::endl; // integral value of the difference of the indices into the array // x[7] - x[5] = 2 ptrdiff_t pdiff = y - z; std::cout << "y - z = " << pdiff << std::endl; return 0; }