answersLogoWhite

0

A pointer variable which is declared but not initialized is called a NULL POINTER.

ex: int *p;

Please don't use the above. A NULL pointer is a specific value assigned to a pointer, just like any other value. NULL is a language-specific designation, and is guaranteed to be comparable to, unlike uninitialized variables, which can have any value.

That is:

int *a;

int *b = NULL;

int *c = (int *) malloc(sizeof(char));

( a c) is NEVER true.

NULL is a reserved word in most high-level languages, and indicates a specific value for assignment. It is commonly used to indicate that something has not yet been assigned a "real" value, or has had its contents deleted. It is an EXPLICIT value, and not just "undefined".

In the context of pointers (which, remember, are really memory location addresses), a NULL pointer is one which has NO value, and thus does NOT point to any memory location. The difference between an uninitialized pointer and a NULL pointer is that most common languages do not specify what value an uninitialized pointer has upon creation (many, such as C, are assigned a random value), while a NULL pointer explicitly has NO value (which is the meaning of NULL).

Many modern languages and compilers will assign NULL to a pointer upon initialization, but don't count on it. It is sloppy programming to do so, and can lead to many hard-to-find errors.

User Avatar

Wiki User

10y ago

What else can I help you with?

Continue Learning about Physics

Why null vector has a direction as it has magnitude 0?

The null vector is a special case where both magnitude and direction are undefined. This vector represents a point in space, rather than a physical quantity with magnitude and direction.


What is difference between null type and deflection type instruments?

Null type instruments require a null balance point to be achieved for accurate measurement, while deflection type instruments measure the quantity directly as a deflection on a scale. Null type instruments are more accurate but require more intricate adjustments, while deflection type instruments are simpler to use but may have lower accuracy.


Why should null point be obtained in the middle one third of wire?

Not always. This null point can be obtained practically on any part of the wire, as this simply depends upon the segmental thicknesses of the wire, the different resistances, cells or other appliances attached on its different segments.


How many equal vectors should be added to get a null vector?

It can be done with any number of them except 1, if they're pointed in theappropriate directions.With any number ' N ' of equal vectors all acting at the same point, their sum iszero (null) if their directions are uniformly distributed and the angle betweeneach adjacent pair is 360/N degrees.-- With two, they have to point in exactly opposite directions.-- With three, they have to be spaced with 120 degrees between adjacent vectors.-- With four, space them 90 degrees apart.etc.


What Difference between null type and deflection type instrument?

Null type instruments require balancing the unknown quantity with a known quantity to obtain a measurement, while deflection type instruments measure the unknown quantity based on the amount of deflection of a pointer or needle. Null type instruments are more accurate but require more setup, while deflection type instruments are simpler to use but may have less precision.

Related Questions

What does the mid point mean in a graph?

null


Do earth has a null point?

Yes, Earth has a magnetic null point, often referred to as the geomagnetic null point, which is a location where the Earth's magnetic field is significantly weakened or nearly zero. This can occur in specific areas due to the complex interactions of the Earth's magnetic field lines. Additionally, in the context of gravity, a "null point" can refer to a point where gravitational forces balance out, such as at the Lagrange points in the Earth-Moon system.


What is null to null bandwidth?

Null to null bandwidth refers to the range of frequencies over which a signal can be accurately transmitted or received without significant distortion or loss. It specifically measures the bandwidth from the lowest frequency point (null) to the highest frequency point (another null) where the signal's amplitude falls below a certain threshold. This concept is important in telecommunications and signal processing, as it helps in determining the effective range of a communication channel or system.


What is a NULL Point of a galvanometer?

Its a point on the galvanometer where the galvanometer shows no deflection as no current passes through it.


What actors and actresses appeared in Null Sonne No Point - 1997?

The cast of Null Sonne No Point - 1997 includes: Lester Bowie as himself Hartmut Geerken as himself Roscoe Mitchell as himself


What is a key point of stretching?

null set ,universal set,cardinality set


What is null point in C programming?

I'm going to go out on a limp here, and guess you mean "Null Pointer." Well, it's a pointer to nothing. For most systems, it's 0, but rather use NULL instead.


What does null means in java?

Null is a value that any variable can have. It means the absence of a value. However, null can only be assigned to object reference variables; attempting to execute a method on a null variable will cause the JVM to throw a NullPointerError.


Explain the principle of null-method of measurement?

The null method is used in measuring the unknown EMF of batteries. The method is about using a potentiometer circuit with the battery of a known and then an unknown EMF connected to it one after the other and locating, in each case, the position of the 'null point'; the point on the potentiometer circuit where the current through the battery is zero.


What is the use of null pointer?

Pointer is a variable that stores address of a variable . A NULL Pointer a pointer that doesn't point to anything, it is a literal zero .Some people ,notably C++ programmers, prefer to use 0 rather than NULL.


What was Maleficent point of view in Snow White the book?

Maleficent is in Sleeping Beauty not Snow White - So her point of view is null


If null is compared with null what is the result-true or false or null or unknown?

You mean SQL? NULL = anything IS NULL NULL <> anything IS NULL ... NULL IS NULL = TRUE NULL IS NOT NULL = FALSE