Why not post the code of how you'd do it with a while loop? Then maybe your best attempt at converting it to a for loop?
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
All of the parts of a for loop are optional. For example, to write an infinite loop you might do this:
for ( ; ; ) {
/* Stuff */
}
Converting a while loop to a for loop is trivial with that little tidbit. Of course, there are other ways, but they require restructuring the loop a bit.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401