please i need to understand step by step all about dynamic allocation in c++
beceuse i use "malloc" but my program has many problems and i thinh if i use dynamic allocation it will be good but i do not know any thing about it so please help me
dynamic allocation in C++ can be achieved with new and deallocation of memory with delete.
allocate memeory to a variable,
int *ip;
ip=new int;
allocate memeory to 1D array
int *ip;
ip=new int[10];
allocate memory to 2d array
int *ip;
ip=new int[][10];
at first you must read an book
there are many of them
after that you can handle with the least information
but if you want to be prof
you must learn on net
c++ awide wide info
so ,if you tired you will get what you need