Home Backend Development C#.Net Tutorial What does c language *p++ mean?

What does c language *p++ mean?

Mar 06, 2019 am 11:39 AM
c language

[*p] means to first take out the data in the address unit pointed to by the pointer p, and then add 1 to the value. Since the priority of the operator [*] is higher than that of the operator [ ], it is First, take the data in the address unit pointed by pointer p, and then the data in the next location pointed to by p.

What does c language *p++ mean?

*p means to first take out the data in the address unit pointed to by the pointer p, and then add 1 to the value. Due to the operation The priority of the symbol * is higher than that of the operator, so the data in the address unit pointed by the pointer p is first fetched, and then, p points to the data in the next location. [Recommended tutorial: C Tutorial]

Since the operator * has a higher priority than the operator , the data in the address unit pointed to by the pointer p is taken first. The details are as follows:

1. Get the value of the current position of the array *p;

2. Then, p points to the data at the next position.

The code running diagram is as follows:

What does c language *p++ mean?

*p: * and are both operators of the same level, right associative. However, the entire expression must be calculated before it is calculated. First, extract the value of the object pointed to by P, and then perform the calculation on P to point to the next object.

*(P): This () is a bit confusing. It needs to be added after the entire expression is calculated. So the same as above, the object value pointed to by P is still extracted. After extraction, P points to the next object. .

(*p): This is different. They get the value first and then the value;

*p: They get the value first and then the value;

Why do some add values ​​and some add addresses? This is the role of brackets, which bind them as a whole. Also look at the combination.

The above is the detailed content of What does c language *p++ mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The meaning of strlength in c language The meaning of strlength in c language Apr 03, 2025 pm 06:18 PM

The strlen() function gets the length of the string, excluding the empty character '\0': 1. Calculate the number of characters without empty characters; 2. Iterate over the string until the empty character is found; 3. Return the length of the string, type size_t.

What does eps mean in C language What does eps mean in C language Apr 03, 2025 pm 05:18 PM

eps in c language is the abbreviation of "epsilon", which represents a very small positive number, which is used to represent errors in floating-point operations. Its uses include: comparing the equality of floating point numbers, determining accuracy limits, serving as a stop condition for iterative algorithms, and preventing numbers from underflowing or overflowing.

What does C language char mean? What does C language char mean? Apr 03, 2025 pm 05:03 PM

char is the data type that stores a single character in C language, occupying 1 byte of memory, with a value range of -128~127, and the default value is '\0' (empty character). It can be used to store and manipulate individual characters, but cannot directly store strings or Unicode characters, and cannot be compared directly with strings.

What does {0} mean in C language What does {0} mean in C language Apr 03, 2025 pm 05:06 PM

In C, braces {} are used to initialize the array, and {0} represents a list of initializers containing unique element 0, initializing all elements of the array to 0. Other uses include: structure initialization ({0} initializes all members to 0), and joint initialization ({0} initializes all members to 0).

What does \0 mean in c language What does \0 mean in c language Apr 03, 2025 pm 05:09 PM

In C language, '\0' represents an empty character, and its uses mainly include: 1. End string as the end flag of the string; 2. Terminate the character array and determine the length by '\0'; 3. Fill in unused memory; 4. In earlier versions, boolean values ​​should be represented, but the bool type should now be used.

What does model mean? What does model mean? Apr 03, 2025 pm 05:36 PM

In C language, model usually refers to a model or modal, which is used to represent patterns or frameworks of different states or behaviors. Specific usages include: 1. Model class: properties and methods containing specific entities or concepts; 2. Modal window: special windows in the user interface that prevent interaction with other windows; 3. Design pattern: templates for predefined solutions to solve common programming problems; 4. State machine: machines that make decisions based on current state and input.

How to define global variables in C language How to define global variables in C language Apr 03, 2025 pm 05:45 PM

Yes, global variables can be defined in C language using the following syntax: Specify the data type of the variable (such as char, int, float) and declare the variable name (identifier) ​​using a semicolon (;) Ending statement For example, define a global character array named name: char name[];

What does swap mean in C language What does swap mean in C language Apr 03, 2025 pm 06:27 PM

In C language, the swap instruction is used to exchange the values ​​of two variables: swap(x, y): swap(x, y): swap the values ​​of x and y can be achieved by using temporary variables or bit operations.

See all articles