// Array of pointers to arrays (looks as a 2D array)
#include <iostream>
using namespace std;
int main()
{
	int a[3] = {5,6,7}, b[2] = {8,9}, *p[2];
	p[0] = a;
	// p[0] is now another name of a.
	p[1] = b;
	// p[1] is now another name of b.
	// p now is like a two-dimensional array. But the first 
	// row has 3 elements while the second has 2.
	cout << a[0] << '\t' << a[1] << '\t' << a[2] << endl;
	// The above is same as:
	cout << p[0][0] << '\t' << p[0][1] << '\t' << p[0][2] << endl;
	cout << b[0] << '\t' << b[1] <<  endl;
	 // The above is same as:
	cout << p[1][0] << '\t' << p[1][1] <<  endl;
	
	// You can print p[0] and p[1] also as follows:
	for (int i = 0; i < 3; i++)
		cout << p[0][i] << '\t';
	cout << endl;
	for (i = 0; i < 2; i++)
                cout << p[1][i] << '\t';
        cout << endl;
	cout << *p[0] << endl; // prints a[0]
	cout << *p[1] << endl; // prints b[0]
	return 0;
}
