can any one help me
every time i come a cross an example in this tutorial i type it in to my compiler instead of copying and pasting to help me remember it better but when i tryed to copy the one in dynamic memory chapter a run time glich acurrs i compared the two thurlly and i can't see a differants i was hoping it might be more obviouse too you
thanks.
#include <iostream>
#include <new>
usingnamespace std;
int main(){
int i,n;
int *p;
cout<<"how many numbers would you like to remember:";
cin>>i;
p= new (nothrow) int [i];
if (p == 0) cout<<"either you enterd 0 or that\n number can't be allocated..";
else {
for (n=0;n<i;n++){
cout<<"\nenter number:";
cin>>p[n];
}
cout<<"you have enterd:";
for(n=0;n<i;n++){cout<<p[n]<<',';
delete []p;}
}
cout<<"\n\n";
system ("pause");
}