// Pointer to an array
#include <iostream>
using namespace std;
int main()
{
	int a[3] = {5,6,7}, *p = a;
	// p is a pointer to array a
	cout << *p << endl; // prints a[0]
	cout << p << endl; // prints memory address of a
			  // which is same as &a[0]
	cout << p[1] << endl; // prints second element of a.
			     // *p[1] is wrong.
	// Now p points to third element of a 
	p += 2;
	cout << *p << endl; // prints 3rd element of a
	for (int i = 0; i < 3; i++)
		cout << p[i] << '\t';
	// Note that we are no exceeding the limits
	cout << endl;
	return 0;
}


