C/C++ Users Journal December 2001 Internet & Network Programming p 56 C++ Made Easier, by Andrew Koenig and Barbara Moo A New Look at for Statements int sum = 0; for (int x; std::cin >> x; ) sum += x; is equivalent to (and better than): int sum = 0; int x; while (std::cin >> x) sum += x;