comp.lang.c
[Top] [All Lists]

Re: K&R2 , exercise 7.6

Subject: Re: K&R2 , exercise 7.6
From: arnuld
Date: Wed, 30 Apr 2008 01:51:30 +0500
Newsgroups: comp.lang.c

> On Tue, 29 Apr 2008 08:27:36 +0000, Richard Heathfield wrote:


> That is almost always a bad idea, because it can suppress diagnostic 
> messages about type matching violations.

well, the programmer knows that he *intentionally* casted the type. 

 
 
> 0 is a null pointer constant. NULL is a null pointer constant. Each of
> the above definitions gives buffer a value that is a null pointer.

from FAQ, I can conclude that, use of NULL is ok where I need a <void*>
and for everything else I can use a 0 (zero). 


> int m = 6;
> int m = 3 + 3;
> 
> Are these equivalent? Do they have the same effect on m? If not, how do
> they vary? What value will m get in the second definition that is
> somehow different to the value it gets in the first? Thinking about this
> very similar issue should enable you to understand the null pointer
> assignments quoted above.


compiler will initialize <m> to a vale of 6. Compiler will get there
differently in both expressions but the end result will be <m> will be
equal 6.

Right ?
 

-- 
http://lispmachine.wordpress.com/
my email ID is at the above address


<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy