Well its just a general programming question. I was going through a topic in which it was clearly written that c++ prefer 0 and not NULL. I wanted to ask that if there is any solid difference btw 0 and NULL?
Well its just a general programming question. I was going through a topic in which it was clearly written that c++ prefer 0 and not NULL. I wanted to ask that if there is any solid difference btw 0 and NULL?
I use NULL with pointers, 0 for everything else. And also 'false' when I can, especially with booleans.
In C? Yes.Originally posted by tu_user
I wanted to ask that if there is any solid difference btw 0 and NULL?
In C++, No.
In C, NULL is defined as 0 typecast to a void pointer, where-as in C++ it's literally defined as 0.
Okeys thankx but u answered only one part of the question. But y? c++ prefers 0 over NULL?
http://www.research.att.com/~bs/bs_faq2.html#nullOriginally posted by tu_user
Okeys thankx but u answered only one part of the question. But y? c++ prefers 0 over NULL?