Hi!

I'm just wondering. Length of data types is dependable on system software (OS). Now, tell me, if this piece of code works on 64-bit machines? Because on 32 bit machines it doesn't - integer is only 32k long.

Code:
int oldVal = 0, newVal;

for (n = 0; n <= 100; n++) {
  newVal = n^2 + oldVal;              //this line!
  oldVal=newVal;
  printf("%d", newVal);
}
Sorry for bothering you, but we had exam and this exercise was in it. I used integer instead of long and I'm just wandering, if it works on 64-bit platform, then I've done it right... Because noone specified it has to be for 32-bit platform...

Zvonko