#include <iostream>
#include <new>
using namespace std;
int main ()
{
int i,n;
int * p;
cout << "How many numbers would you like to type? ";
cin >> i;
p= new (nothrow) int[i];
if (p == 0)
cout << "Error: memory could not be allocated";
else
{
for (n=0; n<i; n++)
{
cout << "Enter number: ";
cin >> p[n];
}
cout << "You have entered: ";
for (n=0; n<i; n++)
cout << p[n] << ", ";
delete[] p;
}
return 0;
for example i want 3 numbers, say the numbers you enter are 1,2,3, it'l will come up ive entered 1,2,3 in that order. i want to know how you reverse that so that it reads what you've typed in,(dynamic memory etc.) then reverses that order. tried about with it but cant get it going? any takers?