Arduino Memory FULL, I don't know why

After ptr3=&C;
the compiler can still decide to discard implementation, since now we have a pointer pointing to a value. The pointer is not used yet.
After Serial.println((unsigned int)ptr3, HEX);
Implementation cannot be discarded anymore.
So indeed:
#pragma GCC optimize ("O0")

1 Like