Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS201 Introduction to Programming GDB Solution Spring Semester July 2013
#1




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

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

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HRM628 VU Current GDB No. 1 Spring April 2012 Solution required Vuhelper 1 3,669 07-22-2020, 08:06 PM
Last Post: Johnnieaunders
  MGT501 Human Resource Management GDB No. 2 Solution 23rd January 2016 Vuhelper 0 1,813 01-23-2016, 06:07 PM
Last Post: Vuhelper
  MTH302 Business Mathematics & Statistics GDB Solution 23rd January 2016 Vuhelper 0 1,676 01-23-2016, 03:39 PM
Last Post: Vuhelper
  STA630 Research Method GDB 2 solution 23rd January 2016 Vuhelper 0 1,983 01-23-2016, 03:15 PM
Last Post: Vuhelper
  MGT211 Introduction To Business GDB No 1 Solution Ideas Fall 2014 Vuhelper 0 1,664 12-04-2014, 03:20 PM
Last Post: Vuhelper
  MGT101 Financial Accounting GDB Solution and Discussion December 2014 Vuhelper 0 2,858 12-03-2014, 09:05 PM
Last Post: Vuhelper
  MGT201 Financial Management GDB No. 01 Solution Fall 2014 Last date is 4th Dec 2014 Vuhelper 0 2,471 12-03-2014, 03:58 PM
Last Post: Vuhelper
  MGT520 International Business GDB No. 01 Solution and Discussion Fall 2014 viki 0 2,583 12-03-2014, 03:03 PM
Last Post: viki
  GDB No 1 MGT301 Principles of Marketing Solution and Discussion December Fall 2014 viki 0 2,503 12-03-2014, 02:45 PM
Last Post: viki
  MGT602 Entrepreneurship GDB No 1 Discussion and Solution Fall 2014 Vuhelper 0 2,474 12-02-2014, 10:36 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)