The following segment of code is part of a program to calculate the NZVC bits when adding two binary numbers together. This particular segment will determine the Z bit (whether or not the entire binary number equals zero).
However, it is an infinite loop and I can't figure out why. I've already nailed down the problem to somewhere in this segment of code, as everything else worked perfectly when I commented it out.
For those wondering, the extra space of b3 (b3) in a 9-space array, contains the Carry-Out (C) bit.
z = 1;
i = 8;
while (z != '0')
if (b3[i] == '1')
z = 0;
cout << "The Zero bit is " << z << endl;