I have this psuedocode, which converts a binary value to a decimal value:
int powTwo = 1;
int dec = 0;
for each character in the string, starting with the last,
if (char == '1')
dec += powTwo;
powTwo *= 2;
How do i write the for each loop specified here, which looks at each character in the string, starting with the last? So far I have
for(Character c : someString)