10-29-2004, 10:45 PM
Rel: Yep, except you'd get an "identifier s not defined" error there, but yeah you get the idea. I don't know how to do that wih malloc'd arrays.
QB would detect that as an error, stop the program, and inform you. It does this by inserting checks to make sure your not going outside the bounds of the array.
C does no such checks, instead it just overwrites whatever memory is where the 5000nth element would be, which usually crashes the program, if not worse.
Right?
Quote:Huh? QB and C are very different about this:Sterling Wrote:In QB, this is also possible ;)Code:int array[10];
array[5000] = 1234;
QB would detect that as an error, stop the program, and inform you. It does this by inserting checks to make sure your not going outside the bounds of the array.
C does no such checks, instead it just overwrites whatever memory is where the 5000nth element would be, which usually crashes the program, if not worse.
Right?