I created an insertion sort for an assignment about a year ago for a data structures and algorithms class and now when I run it the highest number in the sort comes out as a -898549384 or something like that. It didnt used to do that so I thought. I am now using visual studio 2010 could that be it? Here is the code
for (current = 1; current <= last; current++){
hold = array[current];
Here, when current == last you will have overstepped the bounds of the array by one. You probably meant to do current < last.
It didnt used to do that so I thought.
It probably didn't. Overstepping array bounds produces undefined behaviour. In general, undefined behaviour presents itself like this. The program may run fine at one time but could crash the next.