Documentos de Académico
Documentos de Profesional
Documentos de Cultura
if (arregloVacio(array))
cout << endl << "Arreglo vacio";
else {
tam -= 1;
array[1] = tam;
int* temp = new int[cap];
if (temp == NULL)
cout << endl << "Error, no se pudo asignar memoria dinamica al arreglo";
for (int i = 2; i < tam + 2; i++)
{
temp[i] = array[i + 1];
}
delete[] array;
array = temp;
}
return array;
}
void Array::mostrarArray(int* array)
{
int tam, cap;
cap = array[0];
tam = array[1];
if (arregloVacio(array))
{
cout << endl << "Arreglo vacío" << endl;
return;
}
cout << endl << "Tamano\tCapacidad";
cout << endl << tam << "\t" << cap - 2;
cout << endl << "El arreglo es: ";