View more random threads:
- MGT 610 GDB OF BUSINESS ETHICS april 2011
- MGT501 Human Resource Management GDB NO.1 Solution Fall...
- cs402 GDB fall 2010 on 31 jan 2011
- ACC501 GDB 2 Solution
- BNK603 Consumer Banking GDB 02 spring 28 May 2011
- FIN630 - Investment Analysis & Portfolio Management GDB...
- CS304 Object Oriented Programming GDB Solution Spring...
- HRM624 Conflict Management - GDB 1 Spring 2011 Idea...
- ISL201 Islamic Studies GDB No.2 Solution Fall Semester 2012
- ECO402 GDB2 Solution July 2010
CS201 Introduction to Programming GDB Solution Spring Semester July 2013
Dynamic memory allocation by using pointers provides an efficient way of utilizing computer memory but such memory allocation may be problematic if not handled properly in program
Solution: I do agree with this statement, pointer is a powerful feature of c++ and we all know the power can swing both sides good and evil. Pointer if used incorrectly leads to very difficult to unearth bugs which will most probably make you go wild. Every pointer is pointing to a memory location and if value is incorrect then it can lead to disasters of massive magnitude when used on the required block of code.
Dynamic memory allocation is a process that allows us to do exactly what we’re looking to do above, to allocate memory while our program is running, as opposed to telling the computer exactly how much we’ll need (and for what) ahead of time.
With dynamic memory allocation, while the program is running, the program requests more memory from the computer. If there’s enough memory available, the computer will grant the program the right to use the amount it requests.
Computer Memory
Coil Spring
Government Jobs
Two Ways
Local Jobs
Golf Swing
Dynamic Memory Allocation
Allocating memory
There are two ways that memory gets allocated for data storage:
1.Compile Time (or static) Allocation
Memory for named variables is allocated by the compiler
Exact size and type of storage must be known at compile time
For standard array declarations, this is why the size has to be constant
2.Dynamic Memory Allocation
Sponsored Links
Memory allocated “on the fly” during run time
dynamically allocated space usually placed in a program segment known as the heap or the free store
Exact amount of space or number of items does not have to be known by the compiler in advance.
For dynamic memory allocation, pointers are crucial
There are currently 1 users browsing this thread. (0 members and 1 guests)