>>9 sizeof causes no dereference to occur. Only the size of the object (based on its type) is taken into account. This example, double *dp = alloc(sizeof *dp);, is from the C standard itself.
yesh what >>10-san say. Sizeof doesn't evaluate the expression, it just infers the type of the expression, and then retrieves the size of the expression's type.
>>11
Reread the standard you faggot. sizeof() can evaluate an expression.
Name:
Anonymous2012-01-19 16:34
>>11 Sizeof doesn't evaluate the expression, it just infers the type of the expression, and then retrieves the size of the expression's type.
And before you get your panties in a bundle, let me quote the standard...
"The sizeof operator yields the size (in bytes of its operand), which may be an expression or parenthesized name of a type. The size is determined from the type of the operand. The result is an integer. If the type of operand is a variable length array type, the operarand is evaluated; otherwise the operand is not evaluated and the result is an integer constant."
So, shouldn't that actually output sizeof (char *), given a is evaluated (since it's a VLA) and the value of an array is a pointer to its first element?
>>34
I can see a lot of things wrong with it. The program has no intentional side-effects so I will decline to comment on how well defined its behavior is. Print something or return something, right now it's a function of nothing.
YOU MIGHT NOT ONLY HAVE UNDEFINED BEHAVIOR, BUT YOU WILL MIGHT ALSO HAVE A MEMORY LEAK.
WELCOME TO C. THE LANGUAGE THE PROVIDES YOU WITH ENOUGH TOOLS TO FUCK YOURSELF.
Name:
Anonymous2012-01-22 12:10
>>49 >>50
you seem really tense these last few days with your posts.
Did they announce when you're officially going to be a jobless_programmer!!kCq+A64Losi56ze?
Name:
Anonymous2012-01-22 12:19
>>51
I was just trying to help this foolholio by pointing out something that isn't obvious.
Name:
Anonymous2012-01-22 12:22
>>52
I'm always here for you kodak-san when you need a shoulder to cry on.
perl girl is dead
Name:
Anonymous2012-01-22 12:49
>>53
Is Uri still fagging up the perl newsgroups? Oh wait, never mind, I can just go wander over there right now.
Name:
Anonymous2012-01-22 14:08
>>51
The good side of him being fired is cosmic justice, the bad side is he'll have even more time to waste here. Oh well, we can always hope for an endless spiral of unemployment, alcoholism and homelessness.
Name:
Anonymous2012-01-22 14:12
>>55
Well, if all else fails, I'll just go pursue my Ph.D in Chemistry.
But seriously, ever since Kodak filed chapter 11, I've given a lot of thought about possibly pursuing my Ph.D in Computational Fluid Dynamics at Caltech