I always wondered about this as well. I always used basically @jremington 's solution but never trusted the answer. Now I tried both of yours, same answer but, both came out 2298
How can this be when a UNO only has 2k of RAM?
Well I tried this..
void setup() {
int i = 25;
int j = 32;
int* iPoint;
int* jPoint;
Serial.begin (9600);
iPoint = &i; // set the pointer to the address of i
jPoint = &j; // set the pointer to the address of j
Serial.println();
Serial.println((unsigned int)iPoint); // try to print the address of i
Serial.println((unsigned int)jPoint);
}
void loop() {
}
And got..
2298
2296
Jumps 2 bytes. That makes sense. Maybe the UNO has a little more than 2K RAM. And they ain't telling us?
-jim lee