Home > Back-end >  C pointer array pointer - pointer array
C pointer array pointer - pointer array

Time:06-10

 
Double rates [5]={22.22, 33.33, 44.44, 55.55, 66.66};//array
Double * pd=rates;//pointer
Double (* PDS) [5]=& amp; Rates;//array pointer
Double * PDD [5]={& amp; Rates [0], & amp; Rates [1], & amp; Rates [2], & amp; Rates [3], & amp; Rates [4]}.//pointer array
Rates [0]=10.00;
Pd [1]=20.00;
PDS [2]=30.00;//not allowed.
* PDS [2]=30.00;//can be compiled through, but not effective
* PDD [3]=40.00;

Problem: a great god, array pointer comes in where?

CodePudding user response:

refer to the original poster net word reply:
 
Double rates [5]={22.22, 33.33, 44.44, 55.55, 66.66};//array
Double * pd=rates;//pointer
Double (* PDS) [5]=& amp; Rates;//array pointer
Double * PDD [5]={& amp; Rates [0], & amp; Rates [1], & amp; Rates [2], & amp; Rates [3], & amp; Rates [4]}.//pointer array
Rates [0]=10.00;
Pd [1]=20.00;
PDS [2]=30.00;//not allowed.
* PDS [2]=30.00;//can be compiled through, but not effective
* PDD [3]=40.00;

Problem: a great god, array pointer comes in where?

Array pointer can be used to use a two-dimensional array, like using ordinary pointer manipulation similar to one dimensional array

CodePudding user response:

When the pointer as the argument is more effective and save space

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related