Is it possible to declare two variables of different types in a for loop?

Is it possible to declare two variables of different types in a for loop?

瀏覽:709
日期:2026-04-20
for(int i=0,j=0 ... Not possible, but you can do: float f; int i; for (i = 0,f = 0.0; i < 5; i++) { //... } Or, explicitly limit the scope of f and i using additional brackets: { float f; int i; ......看更多