if (decision == "B" || decision == "b"){
for (k =0; k < rows; k++){
for (m =0; m < cols; m++)
switch (image[k][m] = image[k][m] + brightcount)
{
case '0' : cout <<" ";
break;
case '1' : cout <<"-";
break;
case '2' : cout <<"=";
break;
case '3' : cout <<"O";
break;
case '4' : cout <<"Z";
break;
case '5' : cout <<"X";
break;
case '6' : cout <<"B";
break;
case '7' : cout <<"@";
break;
case '8' : cout <<"W";
break;
case '9' : cout <<"#";
break;
}
cout<< (image[k][m]);
cout<< "\n";
}
}
else if (decision == "D" || decision == "d"){
for (k =0; k < rows; k++){
for (m =0; m < cols; m++)
switch (image[k][m] = image[k][m] + darkcount)
{
case '0' : cout <<" ";
break;
case '1' : cout <<"-";
break;
case '2' : cout <<"=";
break;
case '3' : cout <<"O";
break;
case '4' : cout <<"Z";
break;
case '5' : cout <<"X";
break;
case '6' : cout <<"B";
break;
case '7' : cout <<"@";
break;
case '8' : cout <<"W";
break;
case '9' : cout <<"#";
break;
}
cout<< (image[k][m]);
cout<< "\n";
}
}
I'm trying to add more if/else statements inside of these two things going on. If I get some help with the first half I should be able to figure out the second half of it. Anyway for the "B" or "b" statement, if any of the image[k][m] are 0 then I don't want it to do the switch statement because then it'll take 0s and make them -1s which don't have a corresponding case.
I had an if statement right after the for loop had begun like:
for (k =0; k < rows; k++){
for (m =0; m < cols; m++)
if (image[k][m] > 0){
followed by the switch stuff
Then the switch got ended
Then the if statement just made was ended
Then I had an else{
a cout saying "Cannot be brightened any further"
and then closed the else
Finally closed the for loop.
Sorry I still don't have the code there's alot of lines in the program and I didn't want to leave it busted, I returned the code to its last working state.
Anyway I just keep getting flooded with compiler errors, I know it can be done my mind is just fried by this plaguing issue.