dimanche 8 mars 2015

How to iterate a string using while loop in C++?

// number = 100010001111111



for (int i=0; number.length(); i++) {
while number[i] == 1 {
k++;
}
}


I want to iterate this loop only using "while", without "for". How can I do it?


Aucun commentaire:

Enregistrer un commentaire