Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: null vs undefined

Thread Tools

Re: null vs undefined

Victor Bazarov
Posts: n/a
"Web Developer" <(E-Mail Removed)> wrote...
> Whats the difference from null and undefined in C++ as opposed to Java.

What's "undefined" in your sentence? 'null' has only one meaning
in C++ -- it's part of the concept of "null pointer value". That
concept defines a value of a pointer that [in C++ virtual machine]
doesn't represent any object (or function). 'Undefined' is just
that, has no particular definition (whether it's about a value or
behaviour). If you are asking specifically about pointers, then
pointers have undefined values when they are uninitialised. They
have "null pointer value" when you initialise them to be that:

sometype *pointer = 0;

(conversion from an integral expression that evaluates to (int)0
to a pointer to object yields the "null pointer value").


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
typeof x == 'undefined' or x == undefined? -Lost Javascript 13 01-31-2007 12:04 AM
undefined vs. undefined (was: new Array() vs []) VK Javascript 45 09-12-2006 05:26 PM
"stringObj == null" vs "stringObj.equals(null)", for null check?? Java 5 03-29-2006 10:37 PM
First "undefined" then null and now "null" Don Vaillancourt Javascript 13 12-11-2004 04:24 PM
undefined behavior or not undefined behavior? That is the question Mantorok Redgormor C Programming 70 02-17-2004 02:46 PM