After looking at the following code, is my assumption correct that C at first tries to assign a certain address to a variable? And when there are more variables needed 4 bytes are subtracted from some address.
In this example it would be 0x7fff15745074
.
#include <stdio.h>
void f1(){
int one = 1;
printf("\t\t\t\t\t\t&one:\t%p\n", &one);
}
void f2(){
int two = 2;
printf("\t\t\t\t\t\t&two:\t%p\n", &two);
}
void f34(){
int three = 3; int four = 4;
printf("\t\t\t&three:\t%p\t&four:\t%p\n", &three, &four);
}
void f56(){
int five = 5; int six = 6;
printf("\t\t\t&five:\t%p\t&six:\t%p\n", &five, &six);
}
void f789(){
int seven = 7; int eight = 8; int nine = 9;
printf("&seven:\t%p\t&eight:\t%p\t&nine:\t%p\n", &seven, &eight, &nine);
}
int main() {
f1(); f2(); f34(); f56(); f789();
}
output:
&one: 0x7fff15745074
&two: 0x7fff15745074
&three: 0x7fff15745070 &four: 0x7fff15745074
&five: 0x7fff15745070 &six: 0x7fff15745074
&seven: 0x7fff1574506c &eight: 0x7fff15745070 &nine: 0x7fff15745074