Hello,
Your problem is on these lines for (int i = 0; i <= 100; i++), array indices are in range 0 to size-1 (99 in your case), so i must not be above 99. So change these lines to for (int i = 0; i < 100; i++)
And, make sure index++; will never be above 99 or you will have similar issues (buffer overflow)