answersLogoWhite

0

Difference between NULL and NUL

User Avatar

Wiki User

12y ago

Best Answer

NUL usually refers to the NUL device as used in CP/M, DOS and Windows. It is also an abbreviation for the null character ('\0'). NUL has no meaning with regards C/C++.

In C/C++, NULL is a symbol for the value zero (0x00000000 on 32-bit systems). All pointer variables must be initialised before they can be used. If a pointer is not in use, it must be zeroed (nullified).

Example:

#include <iostream>

using namespace std;

int main()

{

cout << "Command\t\tAddressOf (&p)\tPointsTo (p)\tValueAt (*p)" << endl;

cout << "-------\t\t--------------\t------------\t------------" << endl;

int * p; cout << "int * p;" << "\t0x" << &p << "\tN/A\t" << "\tN/A" << endl;

p = new int; cout << "p = new int;" << "\t0x" << &p << "\t0x" << p << "\t" << *p << endl;

*p = 12; cout << "*p = 12;" << "\t0x" << &p << "\t0x" << p << "\t" << *p << endl;

delete( p ); cout << "delete( p );" << "\t0x" << &p << "\t0x" << p << "\t" << *p << endl;

p = NULL; cout << "p = NULL;" << "\t0x" << &p << "\t0x" << p << "\tN/A" << endl << endl;

return( 0 );

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between NULL and NUL
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does nul mean?

Null means zero or invalid.


Is nul negative of positive?

null is zero which is neither positive nor negative


What is the difference between equals 0 and equals NULL?

NULL is for pointers, 0, for numbers


What is the difference between 0 and null?

Nothing - 0, Zero and null are the same things


What is difference between null value and not null value?

Putting it very simply a null value is empty and a not null value contains something.


What is the difference between zero vector and null vector?

They are the same.


What is the difference between a null hypothesis and a research hypothesis?

The null hypothesis is the default hypothesis. It is the hypothesis that there is no difference between the control group and the treatment group. The research hypothesis proposes that there is a significant difference between the control group and the treatment group.


What is the difference between array and string of array?

When we declare an array of characters it has to be terminated by the NULL , but termination by NULL in case of string is automatic.


What is the difference between two source hypothesis and two gospel hypothesis?

null


What is the major difference between the null and alternative hypothesis?

In research, a null hypothesis means that no results will be found. An alternative hypothesis means that results will be found.


What is the difference between alternative hypothesis and null hypothesis?

In research, a null hypothesis means that no results will be found. An alternative hypothesis means that results will be found.


What is the meaning of nul?

No; not any; as, nul disseizin; nul tort.