C++ Advanced C++ Dynamic Memory Allocation Often some situation arises in programming where data or input is dynamic in nature, i.e. the number of data item keeps changing during program execution. A live scenario where program is developed to process lists of employees of an organization. The list grows as the names are added and shrinks as the names get deleted. With the increase in name the memory allocate space to the list to accommodate additional data items. Such situations in programming require dynamic memory management techniques. In this chapter you will learn about how to dynamically allocate memory within a C++ program. What is memory Allocation? There are two ways via which memories can be allocated for storing data. The two ways are: Compile time allocation or static allocation of memory: where the memory for named variables is allocated by the compiler. Exact size and storage must be known at compile time and for array declaration the size has to be constant. ...
In this you get all theory part for languages like C,C++,JAVA and Python