Using vector instead of arrays to prevent most of memory leaks
  Using vector instead of arrays to prevent most of memory leaks
2D Graphics
3D Graphics
Web Design & Development
Business Applications
Business Development
Databases
Desktop Programming
Operating Systems
Video Editing
Miscellaneous
Newsletter
User Login
  • Username
  • Password
Stats
  • Tutorials: 39,022
  • Categories: 572

C and Cpp Tutorials : Using vector instead of arrays to prevent most of memory leaks

Most of beginners define arrays of limited size such as:

int array[100]; // array that can accomodate 100 integer values

These are ok, but your requirement may be different, and you want your application to determines the size of array at runtime, so if your requirement is to use 10 elements only, that means 90 are unused but memory is still allocated for them while application is running. On other hand your application requires 110 elements to be saved, the last 10 will be unallocated spaces if array size is 100, and access to unallocated memory address may result in applciation crash and/or system level damage.
Using vector instead of arrays to prevent most of memory leaks  tutorial
    View Tutorial

Detailed Information

     Tutorial: Using vector instead of arrays to prevent most of memory leaks
     Date Listed: 2007-08-03
     Submitted By: Ali Khan
     Total Hits: 3270
     Rating Tutorial Rating 2.61Tutorial Rating 2.61Tutorial Rating 2.61Tutorial Rating 2.61Tutorial Rating 2.61 (157 votes)

    Discuss Tutorial
    Comment On Tutorial
    View Tutorial
    Report Broken Link

 





© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap