#include
using std::cout;
using std::endl;
void staticArrayInit( void );
void automaticArrayInit( void );
int main()
{
staticArrayInit();
automaticArrayInit();
staticArrayInit();
automaticArrayInit();
return 0;
}
void staticArrayInit( void )
{
static int array1[ 3 ];
for ( int i = 0; i < 3; i++ )
cout << "array1[" << i << "] = " << array1[ i ] << " ";
for ( int j = 0; j < 3; j++ )
array1[ j ] = 0;
}
void automaticArrayInit( void )
{
int array2[ 3 ] = { 1, 2, 3 };
for ( int i = 0; i < 3; i++ )
cout << "array2[" << i << "] = " << array2[ i ] << " ";
for ( int j = 0; j < 3; j++ )
array2[ j ] = 0;
}
array1[0] = 0 array1[1] = 0 array1[2] = 0 array2[0] = 1 array2[1] = 2 array
2[2] = 3 array1[0] = 0 array1[1] = 0 array1[2] = 0 array2[0] = 1 array2[1]
= 2 array2[2] = 3