Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
Array out of BoundsArray out of Bounds Normally bounds are unchecked for
 

Summary: Array out of BoundsArray out of Bounds
Normally bounds are unchecked for
execution efficiency
int all[] = {5,6,7,8,9,10,11,12,13,14};
string names[] = {"dasher", "dancer", "prancer", "vixon", "comet", "cupid",
"donner", "bliltzen", "rudolph", "Joseph"};
all[10] = 47;
// Error doesn't show up until after it completes running normally// Error doesn t show up until after it completes running normally
// Error:RunTime Failure Check #2, stack around the variable "all" was corrupted
Shallow and Deep CopyShallow and Deep Copy
When you pass in an object into a methodWhen you pass in an object into a method
(rather than a pointer to the object), a copy is
createdcreated.
When you exit the method, the destructor is
used to delete the objectused to delete the object.
The problem is the combination of a shallow
i h h d d dcopy on entering the method and a deep
destroy.
class OListNode
{

  

Source: Allan, Vicki H. - Department of Computer Science, Utah State University

 

Collections: Computer Technologies and Information Sciences