|
| ||||||||||
| Tags: c language, c progarming language, container classes, cpp, simple arrays, software coding, software language |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Use container classes rather than simple arrays?
|
|
#2
| |||
| |||
| Re: Use container classes rather than simple arrays?
The main reason why software programmers prefer container classes over simple arrays of C++ is that container classes are considered to be more productive than simple arrays. Another major reason is that a more powerfully built program can be written using container classes instead of the simple arrays. |
|
#3
| ||||
| ||||
| Lesser bugs with container classes
By many it is been noted that programs coded in C++ using the container classes are containing lesser number of bugs as compared to programs written using arrays. Also programs written with container classes are more secured. One of the popularly noted problem with arrays is that subscripts of arrays go unchecked and are not tracked down for out of bound arrays. |
|
#4
| ||||
| ||||
| Container classes provide easy memory management
The storage of Array elements is done on Heap Memory. There is a pitfall for allocating heap storage which is that you will have to assign a code that will always de-allocate the memory space on heap. The advantage with container classes is that the process of memory management is taken care automatically. Thus to have a more easy memory management it is recommended to use Container classes over arrays. |
|
#5
| ||||
| ||||
| Re: Use container classes rather than simple arrays?
Consider an instance where an element has to be inserted in an array. This element has to inserted in between. And this is not possible in array. But this is feasible with container classes. Another characteristic of container class is that the programmer can choose whether to pass by value or pass by reference. But with arrays this is restricted. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Use container classes rather than simple arrays?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| .mov file container | Rufta | Windows Software | 3 | 25-12-2010 02:27 PM |
| Need a .MOV File container | VAIJAYI | Windows Software | 3 | 25-12-2010 03:08 AM |
| The list container of the C++ | BossBattle | Software Development | 5 | 27-02-2010 07:39 PM |
| What is Servlet container? | Sonam Goenka | Software Development | 5 | 05-02-2010 07:13 AM |
| STL container question | JACKOPA | Software Development | 4 | 25-10-2008 04:24 PM |