Page 1 of 1
sizeof()
Posted: Thu Oct 24, 2002 9:34 pm
by PlayOS
Hi again,
Can anyone tell me how the sizeof() function works.
thanks.
Re:sizeof()
Posted: Thu Oct 24, 2002 9:45 pm
by dronkit
sizeof is not a function but an operator implemented directly by the
compiler itself, it doesn't belong to your program and is like a
reserved keyword.
At compile time each sizeof() is evaluated (accordingly) and then replaced
by its value.
The compiler knows the sizes of its data types, so it is trivial to translate the
data type to its type-size.
Re:sizeof()
Posted: Thu Oct 24, 2002 9:45 pm
by dronkit
This question doesn't belong here, either
Re:sizeof()
Posted: Thu Oct 24, 2002 9:49 pm
by PlayOS
Sorry for posting here then, but I thought that it was part of libc, which is directly related to programming an OS based upon the C language. However if people think it to be off topic then I will not post anymore C questions here.
Sorry, and thanks for you answer anyway.