It's not possible, because it does not make much sense.
The first is possible, but the syntax that is wrong would look like this:
for (int a = 0, b = 0; a < 10 && b < 20; a++, b++)
listaA[a] ...
listaB[b] ...
But you will not do what you want. He will not go from 0 to 10 and 0 from 20. He will walk from 0 to 10 and finish. If you use ||
instead of &&
, then you will do the same, when you reach the eleventh element you will be picking up something that should not, and will probably break the application.
This only works if the lists are the same size and you want to scroll the same way, something like this:
for (int a = 0, b = 0; a < 10 && b < 10; a++, b++)
listaA[a] ...
listaB[b] ...
But in most cases it would not even require two variables, it could just be:
for (int a = 0; a < 10; a++)
listaA[a] ...
listaB[a] ...
In the second example, there is no way to do it, and this is one of the reasons to have for
"simple".
In fact, you seldom need to go through two lists at the same time. If we knew the real need there we could give a better solution.