What do you mean? i still exists. I'm just saying that you could use my for loop instead of your for loop. Mine makes use of only one counting variable, pos, whilst yours uses pos as well as ptr. You don't need both counters -- one will suffice.