Jimmy Johnson wrote:
> --- In [email protected], Paul Herring <pauljherr...@...> wrote:
>>
>>> What should it be.  And I hope you don't say
>>>  p = 0;
>> Why not? It means _exactly_ the same thing in most contexts in both C and 
>> C++.
>>
> 
> Because I don't think of a pointer as a boolean, no matter the context.  

Actually, there is a 'bool' type in C++.  But I understand the point. 
I'm old-school and prefer NULL assignments and comparisons.  In C, you 
never assumed that NULL was 0.  Everyone seems to have settled on that 
value as invalid these days, so C++ probably adopted it (too lazy to 
look it up in the Rationale).


I've noticed most people are saying NULL is defined as:

#define NULL   0

I've also seen (probably C):

#define NULL   ((void *)0)

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to