knutson@marconi.sw.mcc.com (Jim Knutson) (06/17/89)
If variables can be declared anywhere, why is the int sum declaration below an error? This happens when using g++ 1.35.0. #include <stream.h> main() { for (int i = 1; i < 10; i++) { int sum += i; // += is a parse error printf("i = %d, sum = %d\n",i,sum); } } -- Jim Knutson knutson@mcc.com cs.utexas.edu!milano!knutson