On Mon, Nov 11, 2024 at 08:49:39AM +0000, arthur miller wrote: [...] > Actually didn't know we can introduce new variable in while declaration in > C++; in C it is verbotten: > > ~/repos/test $ gcc -o test test.c > test.c: In function 'main': > test.c:3:10: error: expected expression before 'int' > 3 | while (int i = 0) { > | ^~~ > test.c:4:5: error: 'i' undeclared (first use in this function) > 4 | i++; > | ^ > test.c:4:5: note: each undeclared identifier is reported only once for each function it appears in AFAIK, it is erlaubt since C99. Cheers -- t