Why can't we define a variable inside a while loop?

Viewed 12137

We can do:

using (Stream s ..)

and:

for (int i ...)

Why can't we as well do something like:

while ((int i = NextNum()) > 0) {..}

I find it very useful and sensible.

6 Answers
Related