S
signuts
I'm aware of what sizeof(...) does, what I would like to know is if
sizeof(...) is compiled in or a function that's executed at run-time.
Like for example
{
int a;
printf("a is %d bytes\n", sizeof(a));
}
would this yield the same "machine code" as it's constant value:
{
int a;
printf("a is %d bytes\n", 4);
}
Another thing I just thought of while writing this up is how are
sizeof(...) and pointers computed? is a pointer architecture specific?
a pointer of type int* and char* both yield 4 bytes on my x86 32bit
machine.
Thank ya much
sizeof(...) is compiled in or a function that's executed at run-time.
Like for example
{
int a;
printf("a is %d bytes\n", sizeof(a));
}
would this yield the same "machine code" as it's constant value:
{
int a;
printf("a is %d bytes\n", 4);
}
Another thing I just thought of while writing this up is how are
sizeof(...) and pointers computed? is a pointer architecture specific?
a pointer of type int* and char* both yield 4 bytes on my x86 32bit
machine.
Thank ya much