if you put a number thats out of the range of an array, could you mess with other programs memory? and if so, could I write a virus that makes itself start on boot and c̶o̶m̶p̶l̶e̶t̶e̶l̶y̶ to a certain extent ruin the host computer?
Your program would probably just crash.