Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the null pointer in C language?

Shulou Source: shulou.com Published: 2022-06-03 17:22:42 11月13日 Update

This article mainly explains "what is the null pointer in c language". Interested friends may wish to take a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the null pointer in c language"?

Description

1. If a pointer does not point to any data, we call it a null pointer.

2. Null is also null in C language, but it is not a data type, but a pointer, and null represents a null pointer.

The system ensures that the null pointer does not point to the actual object or function. In contrast, the address of any object or function cannot be a null pointer.

Example

Judgment that the pointer variable p is a null pointer:

If (p = = 0) if (p = ='0') if (p = = 3-3) if (p = = NULL) / * use NULL must include the corresponding standard library header file * / if (NULL = = p) if (! p) if (p = Q) so far, I believe you have a deeper understanding of "what is a null pointer in c language", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Pointer language content function actual object pointing data learning utility deeper interest variable address instance utility simple operation file method more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Technology Shulou Information Shulou Tech Info macOS