Question: 1. Which statement about the memory allocation is incorrect? 2. Which statement about dynamically array allocation is incorrect? Question 1 Which statement about the memory

1. Which statement about the memory allocation is incorrect?
2. Which statement about dynamically array allocation is incorrect?
1. Which statement about the memory allocation is incorrect?2. Which statement about

Question 1 Which statement about the memory allocation is incorrect? Releasing memeber through the delete statement means the space occupied by the object is given back to the OS. All kinds of the arrays are allocated in the heap memory hence their size can be large. Automatic memory allocation are mostly introduced for function parameters and local variables; static memory allocation are carried out for the static and global variables, User program is responsible for allocating/releasing the dynamically allocated memory. Dynamic memory is allocated from the heap memory managed and the size is much larger than the stack memory, which are used for normal variables. Question 2 Which statement about dynamically array allocation is incorrect? Since the stack memory is limited, programmer usually need to allocate arrays in a dynamical way though the "new" keyword. Dynamically allocation of 2D array can be annoying, since it has to be kept as a pointer to pointer. After C++11 it is possible to initialize a dynamic array using the uniform initializing, The dynamical array is kept as a pointer, and it should be passed to the "delete/" statemenet before the end of the program. Null pointer is particularly useful since classically it indicates the allocated array has been initialized to zero

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!