Unhandled exception (simple insertion sort func)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void insert_sort(int a[], int size)
{
	int index, position;
	for(index = 1; size - 1; index++)
	{
		position = index;
		int key = a[index];

		while(position > 0 && key < a[position-1])
		{
			a[position] = a[position-1];
			position = position - 1;
		}

		a[position] = key;

	}
}


Anyone know why this code will compile but not run? It's kicking back compiler errors that I do not fully understand.
Line 4. size - 1 not a condition.
Can you tell I was having a bad morning?

I came back and looked at it, immediately noticed what was wrong. Prior had been staring at it for thirty minutes going buhuuuuuuu???

Much noobery, many apologize, thanks.
Topic archived. No new replies allowed.