I have the following piece of code:
#include
#include
int main(int argc, char *argv[])
{
int n = 260;
int *p = &n;
You're apparently working on a little-endian machine. What's happening is that you're starting with an int that takes up at least two bytes. The value 260 is 256+4. The 256 goes in the second byte, and the 4 in the first byte. When you write 0 to the first byte, you're left with only the 256 in the second byte.