Can someone tell me how the size of a pointer changes when it is pointing at, say, a single long integer and when it is pointing at a dynamically declared array of long integers?
The size of the pointer doesn't change. It is always 4 bytes (32 bits). When we are looking at an array, the pointer only gives the address of the start of the array. You usually need another variable to tell you the size of the array.
double x[10]; // an array of 10 doubles
double* p = x; // p is a pointer, now pointing at the first double
for (int i=0;i<10;i++)
{
std::cout << *p << std::endl; // output the double value
p++; // make the pointer point to the next one
}