Concept do-while-do-loop
I often need something like a do-while-do loop. In the moment I implement
this concept like this:
Instructions part 1 (for instance: read data)
while(Condition){
Instructions part 2 (save data)
Instructions part 1 (read next data)
}
I have to write part 1 twice, which is ugly. Is it possible to get rid of
the duplicate? I think of a concept like this:
do{
Instructions part 1
} while (Condition) do {
Instructions part 2
}
No comments:
Post a Comment