I was told that if you dont put something at the end of an array to tell the array that that is the end of the array then hackers would be able to minipulate the array and destroy the program and cause the computer to crash.
now i see vectors, which im not clear on except that they are flexible in size as the program goes along.
arrays are vunerable as it is, but what stops a vector from being vunerable to hackers?
arrays have something that says that the array stops here but how does a vector tell the computer that a vector is at its end? if it has an end.
I feel that vectors are more vunerable to hacking than arrays or am i incorrect.
which is better? an array or a vector?