#include <iostream>
const int SIZE = 10;
int* del_index( int* ary, int pos )
{
int* temp = new int[ SIZE - 1 ];
int index;
for( index = 0; index < pos; ++index )
temp[ index ] = ary[ index];
for( index = pos; index < SIZE - 1; ++index )
temp[ index ] = ary[ index + 1 ];
delete[] ary;
return temp;
}
int main()
{
int* ary = new int[ SIZE ];
int index;
int pos = 3;
for( index = 0; index < SIZE; ++index )
{
ary[ index ] = std::rand() % 10;
}
std
::cout << "\n\n BEFORE \n"; for( index = 0; index < SIZE - 1; ++index )
{
std
::cout << ary
[ index
] << " "; }
ary = del_index( ary, pos );
std
::cout << "\n\n AFTER \n"; for( index = 0; index < SIZE - 1; ++index )
{
std
::cout << ary
[ index
] << " "; }
delete[] ary;
return 0;
}