What effect does volatile have on pointers? I got some unexpected behavior while using it
int main() {
volatile uint32_t *ptr=((uint32_t *)(0x00000000+0x00100100));
cout<<ptr<<endl;
uint32_t *ptr1=((uint32_t *)(0x00000000+0x00100100));
cout<<ptr1<<endl;
return 0;
}
"ptr" returns value 1, while "ptr1" return value 0x100100.
What causes this difference?