From 56c1e6b93b6841786ab8b2f3017ddceb37ea0712 Mon Sep 17 00:00:00 2001 From: shruttipriya <55920115+shruttipriya@users.noreply.github.com> Date: Sun, 25 Oct 2020 01:33:37 +0530 Subject: [PATCH] Create cpp-memory-management --- cpp-memory-management | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cpp-memory-management diff --git a/cpp-memory-management b/cpp-memory-management new file mode 100644 index 0000000..e8a0bb3 --- /dev/null +++ b/cpp-memory-management @@ -0,0 +1,21 @@ +#include +using namespace std +int main() +{ +int size; // variable declaration +int *arr = new int[size]; // creating an array +cout<<"Enter the size of the array : "; +std::cin >> size; // +cout<<"\nEnter the element : "; +for(int i=0;i>arr[i]; +} +cout<<"\nThe elements that you have entered are :"; +for(int i=0;i