answersLogoWhite

0

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

13y ago

What else can I help you with?

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 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.


In testing for differences between the means of two related populations the null hypothesis is?

That there is no difference between the means for the two populations.