hi this is vijay i have one doubt in c, can any one clear it
there is 2 address locations 0x1000 & 0x2000, these addresses are assigned to p&q.
in that address we want to place 2&3 values , after that we want to swap both address also values. how this is possible in c program.
Also in c how we can assign the hexa value to a variable.
Last question first: a value is a value is a value; the hexadecimal notation is just
a representation for a value. 0xff (hex), 255 (dec) 0377 (oct) all represent the same
value.
So if you can assign a value in one representation you can assign that same value
in one of the other available representations.
First question last: you can change memory content but you cannot change the
address of memory itself. So you can swap the values 2 and 3 in your example
so that the value 2 ends up in memory location 0x2000 and 3 ends up in memory
location 0x1000, but there is no way you can alter the addresses of those memory
locations. That's how memory works ...
kind regards,
Jos