Headlines News :
Home » , » Dynamic Memory Allocation (C++ Program)

Dynamic Memory Allocation (C++ Program)





//dynamic memory allocation C++ Program.
#include
#include
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
{
cout<<”Enter number: “;
cin>>p[n];
}
cout<<”You have entered: “;
for(n=0;n
cout<
}
return 0;
}
Share this post :
 
Support : Worldwide Solution | Intense Dealz | Your Link
Copyright © 2013. Students Friend - All Rights Reserved
Website maintained by Ankit Jain And Akhil Dadhich
Proudly powered by WWS INDIA