| | |
What is the best value for an empty point in C++?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
As answered by Stroustrup:
•
•
•
•
In C++, the definition of NULL is 0, so there is only an aesthetic difference. I prefer to avoid macros, so I use 0. Another problem with NULL is that people sometimes mistakenly believe that it is different from 0 and/or not an integer. In pre-standard code, NULL was/is sometimes defined to something unsuitable and therefore had/has to be avoided. That's less common these days.
I don't accept change; I don't deserve to live.
•
•
•
•
Just because it is possible to push twigs along the ground with one’s nose does not necessarily mean that that is the best way to collect firewood.
Can you tell me what is your opinion in whether use "NULL" in C++?
Thank you very much !
>I am sorry for that I can't understand what's this sentence's meaning?
Where did you find that sentence? It's nowhere in this thread.
>Can you tell me what is your opinion in whether use "NULL" in C++?
0 and NULL are the same thing in C++. Pick one and use it consistently.
Where did you find that sentence? It's nowhere in this thread.
>Can you tell me what is your opinion in whether use "NULL" in C++?
0 and NULL are the same thing in C++. Pick one and use it consistently.
Last edited by Narue; Jun 6th, 2007 at 3:53 pm.
I'm here to prove you wrong.
The Moderator's Place has been too slow anyway. If you want, I can suggest one:
Ah, that guy can totally read my mind.
•
•
•
•
I hate VB.NET’s continuous bloody interference. I HADN’T FINISHED TYPING YET YOU STUPID COMPILER! CAN’T YOU SEE THAT? DOES IT LOOK TO YOU LIKE I’M DONE TYPING? DID IT NOT OCCUR TO YOU THAT THE REASON YOU’VE FOUND ALL THOSE ERRORS IS BECAUSE I’M NOT FINISHED YET?!! I’LL TELL YOU WHEN I WANT YOU TO CHECK MY WORK, AND NOT BEFORE!
-- Ian Griffiths
I'm here to prove you wrong.
![]() |
Similar Threads
- how do I pass values between classes? (Python)
- DaniWeb Donations (DaniWeb Community Feedback)
Other Threads in the C++ Forum
- Previous Thread: How to find min. spanning tree ?
- Next Thread: problem dealing with constructor
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






