home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,032 of 2,978   
   Femme Verbeek to hwrd69@yahoo.com   
   Re: Mismatched Array Sizes   
   31 Jan 06 02:15:16   
   
   From: fv@nospam.tcenl.com   
      
   hwrd69@yahoo.com schreef:   
   > I am maintaining some legacy code (PASCAL 7) and I have run across a   
   > piece of code I question and am not sure how it is working and not   
   > crashing. There are two arrays that are created (e.g., doubles, w/2000   
   > elements) and a function that can act these arrays (e.g.,   
   > VEC_Add(resultant_array, array1, array2, num_of_elements)). But the   
   > function is passed a num_of_elements that is much greater than the   
   > actual number of elements in the array1 or 2. This function is nothing   
   > more than a loop that adds each element of one to the corresponding   
   > element of the other. However, the loop variable is much more than the   
   > array sizes so:   
   >   
   > 1) where is it getting the data to "add" once it exceeds array1 & 2   
   > length?   
   > 2) won't this just contain garbage? AND   
   > 3) since the initialized resultant array's length is the same as array1   
   > or 2's, won't the resultant array be overwriting possibly something   
   > important?   
   >   
   > Thanks for any responses.   
   >   
      
   Do you have the source code of this function? Can you post a . I can   
   think of a few possibilities besides the ones already mentioned, but it   
   will be guessing as long as we dont know what happens in the procedure.   
      
   --   
   Femme   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca