What makes you think you did something wrong? What is different from what you were expecting?
^ Next time, think about that and answer it preemptively in your original post.
But for now, it looks like the issue is an understanding of array indices.
An array of size 6 has indices 0, 1, 2, 3, 4, 5.
array[i] = (rand() % 6 + 1) produces numbers in range [1, 6].
So when you do sum[array[i]], you have a 1/6 chance of going out of bounds, i.e. sum[6].
You're not seeding the random number generator by calling srand(). That means you're going to get the same sequence of pseudo-random numbers every time you run your program. You should call srand() once at the beginning of main(). http://www.cplusplus.com/reference/cstdlib/srand/