I was just wondering about something that popped into my mind while writing some code.
for (int i = 0; i < num_bits; i++) {
if (bits.at(i) == 0) {
}
else if (bits.at(i) == 1) {
}
}
bits is a string and num_bits is the length of the string. In this case, would the program run string.at(i) at both the if and the else if, or would it run it once and then store it somewhere and use it at both of the statements? I don't know if the question was clear enough, but thanks for any answer.
Aucun commentaire:
Enregistrer un commentaire