Is it possible to assign a variable the address you want, in the memory?
I tried to do so but I am getting an error as \"Lvalue required as left operand of assignmen
Not portably. But some compilers (usually for the embedded world) have extensions to do it.
For example on IAR compiler (here for MSP430), you can do this:
static const char version[] @ 0x1000 = "v1.0";
This will put object version at memory address 0x1000.
version
0x1000