T
tfelb
Hi group!
I read yesterday in a c book something about how does C reference
memory addresses but it's a little bit tricky.
so for example if I have
int num;
and the address of num is 100 then the compiler would treat that
variable internally as (int *)100 so
an address &num IS the same as (int *)100.
So the compiler treat the statement int num = 3; as *(int *)100 = 3
right?
But why I need a pointer type and not for example (int)100 or
unsigned
int(100)?
Thank you!
Tom F.
I read yesterday in a c book something about how does C reference
memory addresses but it's a little bit tricky.
so for example if I have
int num;
and the address of num is 100 then the compiler would treat that
variable internally as (int *)100 so
an address &num IS the same as (int *)100.
So the compiler treat the statement int num = 3; as *(int *)100 = 3
right?
But why I need a pointer type and not for example (int)100 or
unsigned
int(100)?
Thank you!
Tom F.