Tuesday, July 28, 2009

Which error occurs when a user tries to access a non-existent/undefined array element, thus crashing computer?

a) Logical error


b) Syntax error


c) Procedural abstraction error


d) Run-time error

Which error occurs when a user tries to access a non-existent/undefined array element, thus crashing computer?
As everyone is telling you this is language dependant.


Also you are only accessing/reading the array element.


So what is the data type of the Array elements?





If I have an array of 5 elements, Integers, and I access the 10th element I am accessing an unknown piece of memory. As this is an integer, unless the language is going to spot that I out of bounds the integer type will allow me to process any value that it finds in the memory location, which should be 10 Integer positions from the starting location of the Array.





An array out of bounds error should not crash the computer. It may crash the program in which the error occurs.
Reply:This not only depends on the language but quirks of the compiler and what system the binary's run on.
Reply:depends on the language, but usually D - a run time error.

song titles

No comments:

Post a Comment