From what I can gather you're trying to go through a multidimensional array and check if any of the points are equal to "#" or blank.
If you know the size of the array then it would probably be easier to use 2 for loops.
eg:
Code:
for(int a = 0; a < r; a++)
{
for(int b = 0; b < c; b++)
{
//Perform whatever checks here
}
} I think this way would be faster too, don't quote me on that though.