// squares.cpp

// Create an array containing squares of i {0..49}.
// Purposely exceed the array boundary.

#include <iostream>
using namespace std;

int main( )
{
	const int ARRAY_SIZE = 50;

	int squares[50];		// fixed array size

	for( int i = 0; i < ARRAY_SIZE; i++ )
		squares[i] = i * i;

	// You can exceed the array boundary without causing 
	// an exception:

	for( int j = 0; j < ARRAY_SIZE + 5; j++ )
		cout << j << " squared is " << squares[j] << endl;

	return 0;
}