Computer Science, asked by agarpro1010, 1 year ago

What will happen if you assign a value to an array element whose subscript exceeds the size of an array?

Answers

Answered by yashgandhi74
0

EXPLANATION:

I honestly think the example you gave is a bit contrived since I've never experienced having a negative index value, but if that should really be the case, two true/false checks would be still better: i.e. index >= 0 && index < array.count instead of the worst case being n comparisons. – funct7 Sep 3 '16 at 8:25

Answered by Anonymous
0

The program may crash if some important data gets overwritten.

Similar questions