i have here this constructor used 2 display a bitmap
void bitmap::display() const
{
for (int r = 0; r < numrows; r++)
{
for (int c = 0; c < numcols; c++)
{
if (grid[r][c] == 0)
cout << " " ;
else cout << "*";
}
cout << endl;
}
}
i have here this invert function which is meant to make the 0's into 1's and the * into " " but it is not working proply can ne1 help me
void bitmap::invert()
{
for (int r = 0; r < numrows; r++)
{
for (int c = 0; c < numcols; c++)
{
if (grid[r][c] = 1)
{
grid[r][c] = 0;
cout << "*";
}
else{
grid[r][c] = 1;
cout << " ";
}
}
}
}