I have a struct
struct abc{
char c;
char d;
}
And I did
void main(){
struct abc obj;
struct abc obj1;
struct abc obj2;
// char *h=obj;
printf("%x %x %x\n",&obj,&obj1, &obj2);
}
I got printed address like this
1460381e 1460381c 1460381a
First question
Why they are reversed order?
Second Question
every digit in the address is like 1 or 4 or 6 or etc. in the addresses above is 4 bit value. Since Hex is 4 bit to address a single Hex digit. And I am on x86-64 machine then does it mean the addresses which are using 32 bit address. so I am assuming that my x86-64 has 64 in name but basically a 232 = 4,294,967,296 bytes of memory contained. But I recently upgraded my system memory to 16GB so does this mean whatever program I make is basically can only contain 4 GB of memory (assume again hypothetically speaking ). Where all the memory goes. How to increase this number so I can use more memory say I am using Linux and gcc to compile or any system configuration or is it a Linux default?
Question 3
also in above code how much memory does it take to execute and have printf displayed. I am assuming execution of printf
takes care of displaying it on screen. or is there any other address involved containing the displaying thing.
And is it any how possible I can view the address of printf I know I can use dissembler like rasm but does all the addresses in the question I mentioned are virtual address or physical address
Thank for any info