#1 TheMassiveChipmunk is right about the end condition, but I favour the alternative fix. That is keeping the < and then upping the end condition to 10.
And array of n runs from 0 - (n - 1); so for(i = 0; i < n; ++n) is the laziest/clearest form (to my mind).
for(i = 0; i < 10; i++)
But it would be better to define constants.
1 2
|
const int row_count = 10;
const int col_count = 10;
|
And then use them for the array declaration and loops (note: arrays can only be declared with consts; loops don't really care!)
#2 Is there a reason "column" is a string array whereas "place" is a char array?
Given the strings in the "column" array are single letters, you could use a char array there, too.
#3 "spot" may well blow up if you try to use it!
char *spot = &place[10];
You declared the variable "place" to have 10 elements, which in C++ run 0 .. 9. So the 10th element is just off the end of your array. If you mean to get a pointer to the first element of this array, then replace the 10 by 0.
#4 All elements in "place" have a 'o' in them. Is this right?
#5 Where does "star" fit in?
#6 GisleAune's loop idea is cool.
Look for other loops!
Andy