> for (int i=0;i<row_size;i++)
This is C, not C++
You must declare
int i;
at the start of the block, and then
for (i=0;i<row_size;i++)
> attempts++;
Since the preceding if and else both contain continue, how is this line ever executed?
Using a few more braces would help as well.