How do i take in non-space separated imputs C++ : I want to count the number of '#' in a grid. This works if the imput is space separated but it doesn't if its not. How do i make the first one work?
   
    3 3    3 3
    .##    . # #
    #.#    # . #
    ###    # # #
//^Fails    ^Works

    
    using namespace std;
    int main(){
    int h,w,i,o,total=0;
    string current;
    cin >> h >> w;
    for(i=0;i<h;i++){
        for(o=0;o<w;o++){
            cin >> current;
            if(current=="#"){
                total+=1;
            }
        }
    }
    cout << total;
    }