Global Information Lookup Global Information

Null pointer information


In computing, a null pointer or null reference is a value saved for indicating that the pointer or reference does not refer to a valid object. Programs routinely use null pointers to represent conditions such as the end of a list of unknown length or the failure to perform some action; this use of null pointers can be compared to nullable types and to the Nothing value in an option type.

A null pointer should not be confused with an uninitialized pointer: a null pointer is guaranteed to compare unequal to any pointer that points to a valid object. However, in general, most languages do not offer such guarantee. It might compare equal to other, valid pointers; or it might compare equal to null pointers. It might do both at different times; or the comparison might be undefined behaviour. Also, in languages offering such support, the correct use depends on the individual experience of each developer an linter tools. Even when used properly, null pointers are semantically incomplete, since they do not offer the possibility to express the difference between of a "Not Applicable" value versus a "Not known" value or versus a "Future" value.

Because a null pointer does not point to a meaningful object, an attempt to access the data stored at that (invalid) memory location may cause a run-time error or immediate program crash. This is the null pointer error. It is one of the most common types of software weaknesses,[1] and Tony Hoare, who introduced the concept, has referred to it as a "billion dollar mistake".

  1. ^ "CWE-476: NULL Pointer Dereference". MITRE.

and 18 Related for: Null pointer information

Request time (Page generated in 0.8304 seconds.)

Null pointer

Last Update:

In computing, a null pointer or null reference is a value saved for indicating that the pointer or reference does not refer to a valid object. Programs...

Word Count : 1795

Null

Last Update:

representation. Null device, a virtual file that discards data written to it, on Unix systems /dev/null Null pointer or reference (sometimes written NULL, nil,...

Word Count : 288

Segmentation fault

Last Update:

often occur because of errors in pointer use, particularly in C dynamic memory allocation. Dereferencing a null pointer, which results in undefined behavior...

Word Count : 2433

Tagged pointer

Last Update:

unusable. This means that, for example, a pointer to 0 is never a valid pointer and can be used as a special null pointer value. Unlike the previously mentioned...

Word Count : 1526

Dangling pointer

Last Update:

system is able to detect run-time references to null pointers, a solution to the above is to assign 0 (null) to dp immediately before the inner block is...

Word Count : 1781

Null character

Last Update:

abbreviated as NUL (or NULL, though in some contexts that term is used for the null pointer). In 8-bit codes, it is known as a null byte. The original meaning...

Word Count : 959

Nullable type

Last Update:

pointers that can be NULL require the user to check the pointer before using it and require specific code to handle the case when the object pointer is...

Word Count : 704

C syntax

Last Update:

programmers [who?] then set the pointer variable to NULL: free(a); a = NULL; This ensures that further attempts to dereference the pointer, on most systems, will...

Word Count : 9787

Yoda conditions

Last Update:

confuse == with =. The advantage of avoiding null behavior can also be considered a disadvantage, as null pointer errors can be hidden and only appear much...

Word Count : 990

Null object pattern

Last Update:

no appropriate object available. A null reference is impossible in standard-conforming C++. A null Animal* pointer is possible, and could be useful as...

Word Count : 2801

Void safety

Last Update:

null pointer to his design of the ALGOL W language and called it a "mistake": I call it my billion-dollar mistake. It was the invention of the null reference...

Word Count : 617

Sentinel node

Last Update:

singly linked list. The first one uses the sentinel value NULL, and the second one a (pointer to the) sentinel node Sentinel, as the end-of-list indicator...

Word Count : 1243

Linked list

Last Update:

= NULL; // initialize invalid links to nil. if (head == NULL) { head = temp; // If the linked list is empty (i.e., the head node pointer is a null pointer)...

Word Count : 7835

Zero page

Last Update:

Windows actually make the zero page inaccessible to trap uses of null pointers. Such pointer values may legitimately indicate uninitialized values or sentinel...

Word Count : 1401

Offsetof

Last Update:

offsetof(st, m) \ ((size_t)&(((st *)0)->m)) This can be understood as taking a null pointer of type structure st, and then obtaining the address of member m within...

Word Count : 939

None

Last Update:

expression for rejecting all available candidates None, the keyword for the null pointer in Python Nones (disambiguation) Nothing (disambiguation) Zero (disambiguation)...

Word Count : 157

C dynamic memory allocation

Last Update:

might return a null pointer and it is good programming practice to check for this: int *array = malloc(10 * sizeof(int)); if (array == NULL) { fprintf(stderr...

Word Count : 4126

Memory safety

Last Update:

Null pointer dereference – dereferencing an invalid pointer or a pointer to memory that has not been allocated Wild pointers arise when a pointer is...

Word Count : 1760

PDF Search Engine © AllGlobal.net