当前位置:网站首页>Understanding of pointers

Understanding of pointers

2022-06-11 02:00:00 Jihai

1. Pointer definition

( First level pointer )

 

 ( The secondary pointer )---- Continued above

 

 

2. test

( First level pointer )

( The secondary pointer )

 3. If the formal parameter of a function is a pointer , Then the actual parameters of the call I want the address , If you need Take the address symbol & It depends on the actual parameter itself yes Variable still The pointer . yes Variable , To get the address , yes The pointer Don't To get the address .

 

---- When a pointer is assigned ,*p=&i And p=&i What's the difference? ?

    1.*p=&i The result is *p The value of is a variable i The address of ;p=&i The result is p Point to variable i The address of ,*p The value of is i.    2.*p Represents the value of the address pointed to by the reference pointer .( The pointer of the pointer )
       *p=&i,p It's a secondary pointer , namely p Point to another pointer , Then the pointer points to i The address of , Or indirectly i Of Address .
        p=&i, Express p Direct to i The address of .

原网站

版权声明
本文为[Jihai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020622358539.html