How can I remove the whitespace at the end of each line

  2d, arrays, c++

void printSudoku9x9(int grid[9][9]) {

for (int y = 0; y < 9; y++){
    for (int x = 0; x < 9; x++)
        cout << grid[y][x] <<' ';
    cout << endl;
}

}

Source: Windows Questions C++

LEAVE A COMMENT