Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Re: Seeking computer-programming job (Sunnyvale, CA)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Guest, post: 3872170"] no. Think about it from the compiler's point of view. It actually has enough information to calculate the value of "sizeof *foo" without dereferencing foo. It doesn't need to know the value of foo but only the type of foo. And since it's the compiler it can simply look up the type of foo in an internal table and substitute the size of type of foo. Which it also *must* know since its the compiler (baring incomplete definitions etc.). calloc (sizeof *foo); might well compile to load R1 #sizeof(struct-tm) call calloc where #sizeof(struct-tm) is some sort of internal compiler directive that in turn expands to something like load R1 LIT 24 in in a more compact assembler ld r1 #24 In fact not only is the compiler *able* to do this but it is *required* to do this. sizeof is not a function call but an operator printf ("%ul\n", sizeof (* ((int*)0) )); won't crash (assuming I got all me brackets right!) <snip> -- Nick Keighley But ye have set at nought all my counsel, and would none of my reproof: I also will laugh at your calamity; I will mock when your fear cometh; [Proverbs 1:25] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Re: Seeking computer-programming job (Sunnyvale, CA)
Top