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