Free Hosting

C++ Program with dynamic memory allocation with new keyword

C:\Users\Jatinder\Desktop\example27_cpp.html <!-- Exported by C-Free C/C++ IDE
#include<iostream.h>
#include<conio.h>
int main()
{
 clrscr();
 int *pArr=new int[10];
 int *pin=new int;
 cout<<"Enter the number of elements in an array"<<endl;
 cin>> *pin;
 cout<<"Enter the elements one by one" <<endl;
 for (int i=0; i<*pin; i++)
     {
  cin>>pArr[i];
     }
 cout<<"Array elements are"<<endl;
 for (int j=0; j<*pin; j++)
   {
  cout<<endl<<pArr[j];
   }
 delete pin;
 delete[]pArr;
 getch();
 return 0;
}

-->

4 comments:

  1. I always emailed this website post page to all my associates, for the
    reason that if like to read it then my contacts will too.
    Here is my weblog ; advice

    ReplyDelete
  2. What's Happening i am new to this, I stumbled upon this I have found It positively useful and it has helped me out loads. I hope to give a contribution & help different customers like its aided me. Good job.

    Also visit my web blog ... www.propertywide.co.uk

    ReplyDelete
  3. I am not sure where you're getting your info, but great topic. I needs to spend some time learning much more or understanding more. Thanks for wonderful information I was looking for this info for my mission.

    Feel free to surf to my site - site

    ReplyDelete
  4. My brother suggested I might like this blog. He was totally right.
    This post actually made my day. You cann't imagine just how much time I had spent for this info! Thanks!

    Also visit my blog post View Website

    ReplyDelete

Blogger Template by Clairvo