Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between * paired 1 and * (paired 1) in C language

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

The main content of this article is to explain "what is the difference between * paired 1 and * (paired 1) in C language". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what's the difference between * paired 1 and * (paired 1) in C language"!

The difference is: 1, * p represents the content stored in the memory address that this pointer points to, p represents the name of a pointer variable; 2, * p is generally a variable or constant consistent with the pointer type, p outputs a hexadecimal number; 3, * p allows the program to go to that address to retrieve data, p stores the address.

The operating environment of this tutorial: windows7 system, Craft 17 version, Dell G3 computer.

In C language, * p and p are commonly used in pointers to represent a pointer variable, the difference between * p and p:

1. The meaning of the expression is different

* p indicates what is stored in the memory address that this pointer points to.

P represents the name of a pointer variable and refers to the memory address that the pointer variable points to.

2. The output format is different.

* p is generally a variable or constant that is consistent with the pointer type.

P outputs a hexadecimal number and the address of a pointer.

3. Different functions

* p is to ask the program to go to that address to retrieve data.

P stores the address.

Example:

1 、

Int a [5] = {1, 2, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 4, 5, 5, 5, 4, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5

2 、

Int a [5] = {1, 2, 2, 3, 4, 5}; int * pincedard / declaration pointer variable pp = a

Extended data

(* p) an operation is an operation that returns the value of p as the value of that space of the address. (& p) is an operation that returns the address that was opened when p was declared. You can assign a value to a memory address with an assignment statement.

Example:

Int * ptinct pacifism 2003 Hutchen pamphlet 3000H

Results:

* * paired * (* (p)) = * (2003H) = * (3000H) = 3000H. & & pause & (& (p)) = & (3001H), an error occurred at this time. 3001H is a constant and cannot be stored at the address. * & pumped * (& (p)) = * (3001H) = 2003H, that is, * & pumped. At this point, I believe you have a deeper understanding of "what is the difference between * paired 1 and * (paired 1) 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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report