{"id":87161,"date":"2026-07-29T22:48:31","date_gmt":"2026-07-29T14:48:31","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/87161.html"},"modified":"2026-07-29T22:48:31","modified_gmt":"2026-07-29T14:48:31","slug":"%e4%ba%8c%e7%bb%b4%e6%95%b0%e7%bb%84%e7%94%a8int-p%e4%b8%ba%e4%bb%80%e4%b9%88%e4%b8%8d%e8%a1%8c%ef%bc%9f%e9%82%a3%e4%b8%aa%e6%8b%ac%e5%8f%b7%e5%88%b0%e5%ba%95%e6%80%8e%e4%b9%88%e8%af%bb%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/87161.html","title":{"rendered":"\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f"},"content":{"rendered":"<h3>1. \u4e00\u4e2a\u7f16\u8bd1\u5668\u7684&#034;\u5acc\u5f03&#034;<\/h3>\n<p>\u81ea\u4ece\u6628\u5929&#xff08;Day12&#xff09;\u641e\u61c2\u4e86 int *p &#061; a; \u80fd\u904d\u5386\u4e00\u7ef4\u6570\u7ec4&#xff0c;\u6211\u4eca\u5929\u5c31\u6709\u70b9&#034;\u98d8\u4e86&#034;\u3002\u7ec3\u4e60\u65f6\u9047\u5230\u4e00\u4e2a int a[3][4]&#xff0c;\u6211\u60f3\u90fd\u6ca1\u60f3&#xff0c;\u4e0b\u610f\u8bc6\u5c31\u6572\u51fa\u4e86\u540c\u4e00\u62db&#xff1a;<\/p>\n<p>int a[3][4] &#061; {1,2,3,4,5,6,7,8,9,10,11,12};<br \/>\nint *p &#061; a;  \/\/ \u6628\u5929\u4e0d\u90fd\u8fd9\u4e48\u7528\u5417&#xff1f;\u6ca1\u95ee\u9898\u5427&#xff1f;<\/p>\n<p>\u7ed3\u679c&#xff0c;\u7f16\u8bd1\u5668&#034;\u556a&#034;\u4e00\u4e0b\u7529\u7ed9\u6211\u4e00\u4e2a\u8b66\u544a&#xff1a;&#034;assignment from incompatible pointer type&#034; \u2014\u2014 \u7c7b\u578b\u4e0d\u517c\u5bb9&#xff01;\u5f53\u65f6\u5c31\u7ed9\u6211\u6574\u6e05\u9192\u4e86\u3002\u4eca\u5929\u5c31\u6765\u6b7b\u78d5\u8fd9\u4e2a&#034;\u7c7b\u578b\u4e0d\u517c\u5bb9&#034;\u80cc\u540e\u5230\u5e95\u85cf\u7740\u4ec0\u4e48\u3002<\/p>\n<h3>2. \u6682\u505c\u4e00\u4e0b&#xff0c;\u5148\u60f3\u6e05\u695a&#xff1a;int *p &#061; a \u51ed\u5565\u80fd\u7ba1\u4e00\u7ef4\u6570\u7ec4&#xff1f;<\/h3>\n<p>\u5728\u641e\u61c2\u4e8c\u7ef4\u6570\u7ec4\u7684\u62a5\u9519\u524d&#xff0c;\u6211\u5fc5\u987b\u5148\u6b7b\u78d5\u4e00\u4e2a\u5173\u952e\u70b9&#xff1a;\u6307\u9488\u7684\u7c7b\u578b&#xff0c;\u662f\u7531&#034;\u9996\u5143\u7d20&#034;\u7684\u7c7b\u578b\u51b3\u5b9a\u7684\u3002<\/p>\n<p>\u6bd4\u5982\u4e00\u7ef4\u6570\u7ec4 int a[4]&#xff0c;\u5b83\u7684\u9996\u5143\u7d20 a[0] \u662f\u4e2a\u666e\u666e\u901a\u901a\u7684 int\u3002\u6240\u4ee5&#xff0c;&amp;a[0] \u5c31\u662f int * \u7c7b\u578b\u3002\u90a3 int *p &#061; a; \u5f53\u7136\u5929\u7ecf\u5730\u4e49&#xff0c;p \u77e5\u9053\u81ea\u5df1\u4e00\u6b21\u8d70 4 \u4e2a\u5b57\u8282&#xff08;\u4e00\u4e2a int \u7684\u5927\u5c0f&#xff09;&#xff0c;\u9760 *(p&#043;i) \u5c31\u80fd\u987a\u85e4\u6478\u74dc\u3002<\/p>\n<p>\u597d\u4e86&#xff0c;\u6838\u5fc3\u601d\u60f3\u6709\u4e86&#xff1a;\u6307\u9488&#xff0c;\u8981\u548c&#034;\u9996\u5143\u7d20&#034;\u7684\u7c7b\u578b\u5bf9\u9f50\u3002 \u5e26\u7740\u8fd9\u4e2a\u6807\u51c6&#xff0c;\u6211\u4eec\u518d\u53bb\u5ba1\u89c6\u4e8c\u7ef4\u6570\u7ec4&#xff0c;\u770b\u770b\u5b83\u7684&#034;\u9996\u5143\u7d20&#034;\u5230\u5e95\u662f\u4e2a\u5565\u3002<\/p>\n<h3>3. \u6211\u7684\u9519\u8bef\u5199\u6cd5\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u9519<\/h3>\n<h4>3.1 \u9519\u8bef\u5199\u6cd5<\/h4>\n<p>\u56de\u5230\u4e00\u5f00\u59cb\u90a3\u4e2a\u8ba9\u6211\u6293\u72c2\u7684\u4ee3\u7801&#xff1a;<\/p>\n<p>int a[3][4] &#061; {1,2,3,4,5,6,7,8,9,10,11,12};<br \/>\nint *p &#061; a;  \/\/ \u7f16\u8bd1\u8b66\u544a&#xff1a;\u4e0d\u517c\u5bb9\u7684\u6307\u9488\u7c7b\u578b<\/p>\n<p>\u6211\u5fc3\u91cc\u8fd8\u5728\u60f3&#xff1a;\u6570\u7ec4\u540d a \u4e0d\u5c31\u662f\u9996\u5143\u7d20\u5730\u5740\u5417&#xff1f;\u5728\u4e00\u7ef4\u6570\u7ec4\u91cc\u5c31\u662f\u8fd9\u4e48\u7528\u7684&#xff0c;\u600e\u4e48\u5230\u8fd9\u91cc\u5c31\u884c\u4e0d\u901a\u4e86&#xff1f;<\/p>\n<h4>3.2 \u6839\u672c\u539f\u56e0&#xff1a;\u4e8c\u7ef4\u6570\u7ec4\u7684\u9996\u5143\u7d20\u5230\u5e95\u957f\u4ec0\u4e48\u6837<\/h4>\n<p>\u95ee\u9898\u5c31\u51fa\u5728\u5bf9\u201c\u9996\u5143\u7d20\u201d\u7684\u7406\u89e3\u4e0a\u3002\u4e00\u7ef4\u6570\u7ec4 int a[4] \u7684\u9996\u5143\u7d20\u662f a[0]&#xff0c;\u7c7b\u578b\u662f int&#xff0c;\u6240\u4ee5 &amp;a[0] \u7684\u7c7b\u578b\u662f int *&#xff0c;\u76f4\u63a5\u8d4b\u7ed9 int *p \u5b8c\u5168\u6ca1\u95ee\u9898\u3002<\/p>\n<p>\u4f46\u662f\u4e8c\u7ef4\u6570\u7ec4 int a[3][4] \u7684\u672c\u8d28\u662f\u4e00\u7ef4\u6570\u7ec4\u7684\u6570\u7ec4\u3002\u4f60\u53ef\u4ee5\u628a\u5b83\u62c6\u5f00\u770b&#xff1a;int[4] a[3]&#xff0c;\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u8fd9\u4e2a\u4e8c\u7ef4\u6570\u7ec4\u7531 3 \u4e2a\u5143\u7d20\u7ec4\u6210&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u672c\u8eab\u662f\u4e00\u4e2a\u5305\u542b 4 \u4e2a int \u7684\u4e00\u7ef4\u6570\u7ec4\u3002\u56e0\u6b64&#xff1a;<\/p>\n<ul>\n<li>\u9996\u5143\u7d20&#xff1a;a[0]&#xff0c;\u5b83\u7684\u7c7b\u578b\u662f int[4]&#xff08;\u4e00\u4e2a\u6709 4 \u4e2a int \u7684\u6570\u7ec4&#xff09;<\/li>\n<li>\u9996\u5143\u7d20\u7684\u5730\u5740&#xff1a;&amp;a[0]&#xff0c;\u7c7b\u578b\u5c31\u662f int[4] *&#xff0c;\u4e5f\u5c31\u662f\u6307\u5411\u201c\u5305\u542b 4 \u4e2a int \u7684\u6570\u7ec4\u201d\u7684\u6307\u9488\u3002<\/li>\n<\/ul>\n<p>\u800c\u5728 C \u8bed\u8a00\u91cc&#xff0c;\u6307\u5411\u6570\u7ec4\u7684\u6307\u9488\u5fc5\u987b\u5199\u6210\u4e00\u4e2a\u5f88\u7279\u522b\u7684\u8bed\u6cd5&#xff1a;int (*p)[4]\u3002\u6ce8\u610f&#xff0c;int *p[4] \u662f\u5b8c\u5168\u4e0d\u540c\u7684\u4e1c\u897f&#xff08;\u90a3\u662f\u6307\u9488\u6570\u7ec4&#xff0c;\u540e\u9762\u518d\u804a&#xff09;\u3002\u6240\u4ee5&#xff0c;int *p \u53ea\u80fd\u6307\u5411\u5355\u4e2a int&#xff0c;\u6839\u672c\u6307\u4e0d\u4e86\u4e00\u4e2a int[4] \u7684\u6574\u4f53&#xff0c;\u7f16\u8bd1\u5668\u5f53\u7136\u4f1a\u8b66\u544a\u4f60\u7c7b\u578b\u4e0d\u517c\u5bb9\u3002<\/p>\n<h4>3.3 \u4eba\u8bdd\u603b\u7ed3<\/h4>\n<p>\u4e00\u7ef4\u6570\u7ec4\u7684\u9996\u5143\u7d20\u662f\u666e\u901a\u53d8\u91cf&#xff0c;\u4e8c\u7ef4\u6570\u7ec4\u7684\u9996\u5143\u7d20\u662f\u4e00\u6574\u884c\u7684\u4e00\u7ef4\u6570\u7ec4\u3002\u60f3\u7528\u6307\u9488\u6307\u4e8c\u7ef4\u6570\u7ec4&#xff0c;\u6307\u9488\u7684\u7c7b\u578b\u5fc5\u987b\u80fd\u51c6\u786e\u63cf\u8ff0\u8fd9\u4e00\u884c\u7684\u5927\u5c0f&#xff0c;\u4e5f\u5c31\u662f\u8981\u7528\u6570\u7ec4\u6307\u9488\u3002<\/p>\n<h3>4. \u6b63\u786e\u5199\u6cd5&#xff1a;\u6570\u7ec4\u6307\u9488 int (*p)[4] \u7684\u542b\u4e49\u4e0e\u8bfb\u6cd5<\/h3>\n<p>\u641e\u6e05\u695a\u9996\u5143\u7d20\u7684\u7c7b\u578b\u4e4b\u540e&#xff0c;\u6b63\u786e\u5199\u6cd5\u5c31\u5f88\u81ea\u7136\u4e86&#xff1a;<\/p>\n<p>int a[3][4] &#061; {1,2,3,4,5,6,7,8,9,10,11,12};<br \/>\nint (*p)[4] &#061; a;  \/\/\u7b49\u4ef7\u4e8e int (*p)[4] &#061; &amp;a[0];<\/p>\n<p>\u6ce8\u610f&#xff1a; \u770b\u5230 a \u548c &amp;a[0] \u7b49\u4ef7&#xff0c;\u4f60\u662f\u4e0d\u662f\u60f3\u8d77\u4e86\u6628\u5929\u7684\u5185\u5bb9&#xff1f;\u5bf9&#xff0c;\u8fd9\u4e2a\u89c4\u5219\u6ca1\u53d8&#xff01;\u53ea\u662f\u5728\u4e8c\u7ef4\u6570\u7ec4\u91cc&#xff0c;a[0] \u4e0d\u518d\u662f\u4e00\u4e2a int \u53d8\u91cf&#xff0c;\u800c\u662f\u4e00\u4e2a int[4] \u6570\u7ec4\u3002\u6240\u4ee5 &amp;a[0] \u7684\u7c7b\u578b&#034;\u5347\u7ea7&#034;\u6210\u4e86\u6307\u5411\u6570\u7ec4\u7684\u6307\u9488\u3002\u89c4\u5219\u6ca1\u53d8&#xff0c;\u53d8\u7684\u662f\u89c4\u5219\u4f5c\u7528\u7684\u5bf9\u8c61\u3002\u8fd9\u70b9\u60f3\u901a&#xff0c;\u540e\u9762\u5c31\u4e0d\u4f1a\u4e71\u3002<\/p>\n<p>\u8fd9\u91cc int (*p)[4] \u8bfb\u6cd5\u662f&#xff1a;p \u662f\u4e00\u4e2a\u6307\u9488&#xff0c;\u6307\u5411\u4e00\u4e2a\u5305\u542b 4 \u4e2a int \u7684\u6570\u7ec4\u3002\u62ec\u53f7\u5fc5\u987b\u52a0\u4e0a&#xff0c;\u5426\u5219\u5c31\u53d8\u6210 int *p[4]&#xff08;\u6307\u9488\u6570\u7ec4&#xff09;&#xff0c;\u8fd9\u5c31\u662f\u5178\u578b\u7684\u201c\u62ec\u53f7\u8bfb\u4e0d\u61c2\u201d\u7684\u95ee\u9898\u3002<\/p>\n<p>\u73b0\u5728 p \u6307\u5411\u4e86\u4e8c\u7ef4\u6570\u7ec4\u7684\u9996\u5143\u7d20 a[0]&#xff08;\u5373\u7b2c 0 \u884c&#xff09;&#xff0c;\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u7528\u6307\u9488\u8fd0\u7b97\u8d70\u5230\u4efb\u610f\u4e00\u884c&#xff1a;<\/p>\n<p>p &#043; i;   \/\/ p \u52a0\u4e0a i&#xff0c;\u5b9e\u9645\u8df3\u8fc7\u4e86 i \u4e2a int[4]&#xff0c;\u6240\u4ee5\u6307\u5411\u7b2c i \u884c<\/p>\n<h3>5. \u7528 p \u8bbf\u95ee\u4e8c\u7ef4\u6570\u7ec4\u5143\u7d20\u7684\u5168\u8fc7\u7a0b<\/h3>\n<p>\u6709\u4e86 int (*p)[4]&#xff0c;\u600e\u4e48\u53d6\u51fa\u7b2c i \u884c\u7b2c j \u5217\u90a3\u4e2a\u5177\u4f53\u7684\u503c&#xff1f;\u4e0b\u9762\u4e00\u6b65\u4e00\u6b65\u62c6\u89e3&#xff1a;<\/p>\n<p>\/\/ 1. p&#043;i       \u2192 \u6307\u5411\u7b2c i \u884c&#xff08;\u6574\u4e2a\u4e00\u7ef4\u6570\u7ec4&#xff09;&#xff0c;\u7c7b\u578b\u4ecd\u7136\u662f int(*)[4]<br \/>\n\/\/ 2. *(p&#043;i)    \u2192 \u89e3\u5f15\u7528&#xff0c;\u76f8\u5f53\u4e8e\u7b2c i \u884c\u7684\u4e00\u7ef4\u6570\u7ec4\u540d a[i]&#xff0c;<br \/>\n\/\/                \u6b64\u65f6\u7c7b\u578b\u5df2\u7ecf\u53d8\u6210 int *&#xff08;\u6307\u5411\u8fd9\u4e00\u884c\u7b2c 0 \u4e2a\u5143\u7d20&#xff09;<br \/>\n\/\/ 3. *(p&#043;i)&#043;j  \u2192 \u5728\u7b2c i \u884c\u5185\u90e8\u504f\u79fb j \u4e2a int \u4f4d\u7f6e&#xff0c;\u5f97\u5230\u7b2c i \u884c\u7b2c j \u5217\u5143\u7d20\u7684\u5730\u5740<br \/>\n\/\/ 4. *(*(p&#043;i)&#043;j) \u2192 \u518d\u89e3\u5f15\u7528&#xff0c;\u62ff\u5230\u6700\u7ec8\u7684 int \u5143\u7d20<\/p>\n<p>\u5b8c\u6574\u6f14\u793a\u4ee3\u7801&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nint main() {<br \/>\nint a[3][4] &#061; {1,2,3,4,5,6,7,8,9,10,11,12};<br \/>\nint (*p)[4] &#061; a;  \/\/ \u6570\u7ec4\u6307\u9488&#xff0c;\u6307\u5411\u6574\u884c<br \/>\n\/\/ \u904d\u5386\u6240\u6709\u5143\u7d20<br \/>\nfor (int i &#061; 0; i &lt; t; 3; i&#043;&#043;) {<br \/>\n    for (int j &#061; 0; j &lt; t; 4; j&#043;&#043;) {<br \/>\n        printf(&#034;a[%d][%d] &#061; %d\\\\n&#034;, i, j, *(*(p &#043; i) &#043; j));<br \/>\n    }<br \/>\n}<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>\u6700\u7ec8\u4f60\u4f1a\u53d1\u73b0&#xff1a;*(*(p&#043;i)&#043;j) \u548c a[i][j] \u4ee5\u53ca p[i][j] \u5b8c\u5168\u7b49\u4ef7\u3002\u867d\u7136 p[i][j] \u8fd9\u79cd\u4e0b\u6807\u5199\u6cd5\u6700\u76f4\u89c2&#xff0c;\u4f46\u7406\u89e3\u5e95\u5c42 *(*(p&#043;i)&#043;j) \u7684\u8f6c\u6362\u8fc7\u7a0b&#xff0c;\u624d\u80fd\u771f\u6b63\u660e\u767d\u6570\u7ec4\u6307\u9488\u5728\u5185\u5b58\u91cc\u662f\u600e\u4e48\u5de5\u4f5c\u7684\u3002<\/p>\n<h3>6. \u5b57\u7b26\u578b\u4e8c\u7ef4\u6570\u7ec4\u4e0e\u6307\u9488\u6570\u7ec4\u7684\u533a\u522b<\/h3>\n<p>\u4e8c\u7ef4\u6570\u7ec4\u7684\u9ebb\u70e6\u8fd8\u6ca1\u5b8c&#xff0c;\u6362\u5230\u5b57\u7b26\u7c7b\u578b\u4e00\u6837\u5b58\u5728\u5751\u3002\u6bd4\u5982\u8981\u5b58\u591a\u4e2a\u5b57\u7b26\u4e32&#xff1a;<\/p>\n<p>char s[3][10] &#061; {&#034;hello&#034;, &#034;world&#034;, &#034;china&#034;};  \/\/ \u56fa\u5b9a\u5bbd\u5ea6 10 \u7684\u4e8c\u7ef4\u5b57\u7b26\u6570\u7ec4<\/p>\n<p>\u540c\u6837\u53ef\u4ee5\u7528\u6570\u7ec4\u6307\u9488\u6765\u64cd\u4f5c\u5b83&#xff1a;<\/p>\n<p>char (*p)[10] &#061; s;       \/\/ p \u6307\u5411\u6bcf\u4e2a char[10] \u884c<br \/>\nfor (int i &#061; 0; i &lt; 3; i&#043;&#043;) {<br \/>\n    printf(&#034;%s\\\\n&#034;, *(p &#043; i)); \/\/ *(p&#043;i) \u662f char * \u6307\u5411\u5f53\u524d\u884c\u5b57\u7b26\u4e32<br \/>\n}<\/p>\n<p>\u4f46\u5b9e\u9645\u4e2d&#xff0c;\u8fd9\u4e9b\u5b57\u7b26\u4e32\u957f\u5ea6\u5dee\u522b\u5f88\u5927&#xff0c;\u7528\u56fa\u5b9a\u957f\u5ea6\u7684\u4e8c\u7ef4\u6570\u7ec4\u5f88\u6d6a\u8d39\u7a7a\u95f4\u3002\u4e8e\u662f\u8fd8\u6709\u53e6\u4e00\u79cd\u65b9\u5f0f\u2014\u2014\u6307\u9488\u6570\u7ec4&#xff1a;<\/p>\n<p>char *s[3] &#061; {&#034;hello&#034;, &#034;world&#034;, &#034;china&#034;}; \/\/ \u6bcf\u4e2a\u5143\u7d20\u662f char * \u6307\u9488<\/p>\n<p>\u8fd9\u91cc s \u662f\u4e00\u4e2a\u6570\u7ec4&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u662f\u6307\u5411\u5b57\u7b26\u4e32\u5e38\u91cf\u533a\u67d0\u4e2a\u4f4d\u7f6e\u7684 char * \u6307\u9488\u3002\u90a3\u4e48\u60f3\u7528\u6307\u9488\u64cd\u4f5c\u8fd9\u4e2a\u6570\u7ec4\u65f6&#xff0c;\u9700\u8981\u6307\u5411 char * \u7684\u6307\u9488&#xff0c;\u4e5f\u5c31\u662f char **&#xff1a;<\/p>\n<p>char **p &#061; s;  \/\/ \u6216\u8005\u5199\u6210 char *(*p) \u4e5f\u53ef\u4ee5&#xff0c;\u4f46\u4e00\u822c\u76f4\u63a5\u7528\u4e8c\u7ea7\u6307\u9488<br \/>\nfor (int i &#061; 0; i &lt; 3; i&#043;&#043;) {<br \/>\n    printf(&#034;%s\\\\n&#034;, *(p &#043; i)); \/\/ p[i] \u5c31\u662f\u7b2c i \u4e2a\u5b57\u7b26\u4e32<br \/>\n}<\/p>\n<p>\u5c0f\u7ed3\u4e00\u4e0b\u5bb9\u6613\u641e\u6df7\u7684\u4e09\u79cd\u7c7b\u578b&#xff1a;<\/p>\n<ul>\n<li>int (*p)[4]&#xff1a;\u6570\u7ec4\u6307\u9488&#xff0c;\u6307\u5411\u5305\u542b 4 \u4e2a int \u7684\u6570\u7ec4&#xff0c;\u7528\u4e8e\u6307\u5411\u4e8c\u7ef4\u6570\u7ec4\u7684\u6574\u884c\u3002<\/li>\n<li>int *p[4]&#xff1a;\u6307\u9488\u6570\u7ec4&#xff0c;\u4e00\u4e2a\u5305\u542b 4 \u4e2a int * \u5143\u7d20\u7684\u6570\u7ec4&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u662f\u6307\u5411 int \u7684\u6307\u9488\u3002<\/li>\n<li>char **p&#xff1a;\u4e8c\u7ea7\u6307\u9488&#xff0c;\u6307\u5411\u4e00\u4e2a char * \u53d8\u91cf&#xff0c;\u5e38\u7528\u4e8e\u7ba1\u7406\u5b57\u7b26\u4e32\u6307\u9488\u6570\u7ec4\u3002<\/li>\n<\/ul>\n<p>\u533a\u5206\u7684\u5173\u952e\u6c38\u8fdc\u662f\u5148\u770b\u62ec\u53f7&#xff0c;\u518d\u770b\u4fee\u9970&#xff0c;\u4ece\u91cc\u5f80\u5916\u8bfb&#xff0c;\u624d\u80fd\u628a\u6307\u9488\u7684\u7c7b\u578b\u8bf4\u6e05\u695a\u3002<\/p>\n<h3>7. \u4eca\u65e5\u907f\u5751\u6307\u5357<\/h3>\n<table border=\"1\" cellpadding=\"8\" cellspacing=\"0\">\n<tr>\u5751\u70b9\u522b\u8fd9\u4e48\u5e72&#xff0c;\u56e0\u4e3a&#8230;<\/tr>\n<tbody>\n<tr>\n<td>\u7528 int *p \u6307\u5411\u4e8c\u7ef4\u6570\u7ec4<\/td>\n<td>\u4eba\u5bb6\u4e8c\u7ef4\u6570\u7ec4\u7684&#034;\u7b2c\u4e00\u4e2a\u5c0f\u5f1f&#034;\u662f\u4e00\u6574\u884c&#xff08;int[4]&#xff09;&#xff0c;\u4e0d\u662f\u5355\u4e2a int\u3002\u4f60\u7528 int * \u53bb\u6307&#xff0c;\u5c31\u50cf\u7528\u6469\u6258\u8f66\u9a7e\u7167\u5f00\u5927\u5df4&#xff0c;\u80af\u5b9a\u4e0d\u884c\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u6df7\u6dc6 int (*p)[4] \u548c int *p[4]<\/td>\n<td>\u8fd9\u662f\u4eca\u5929\u62ec\u53f7\u8bfb\u6cd5\u7684\u6838\u5fc3\u3002\u62ec\u53f7\u5728\u54ea&#xff0c;\u610f\u4e49\u5c31\u5728\u54ea\u3002\u8bb0\u6b7b&#xff1a;(*p) \u5148\u7ed3\u5408\u8bf4\u660e p \u662f\u6307\u9488&#xff0c;\u6240\u4ee5\u662f\u6570\u7ec4\u6307\u9488&#xff1b;p[4] \u5148\u7ed3\u5408\u8bf4\u660e p \u662f\u6570\u7ec4&#xff0c;\u6240\u4ee5\u662f\u6307\u9488\u6570\u7ec4\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u5fd8\u4e86 *(p&#043;i) \u62ff\u5230\u7684\u662f&#034;\u884c\u5730\u5740&#034;<\/td>\n<td>*(p&#043;i) \u89e3\u5f15\u7528\u4e00\u6b21\u540e&#xff0c;\u4f60\u62ff\u5230\u7684\u662f\u8fd9\u4e00\u884c\u7684&#034;\u6570\u7ec4\u540d&#034;&#xff0c;\u7c7b\u578b\u662f int*&#xff0c;\u8fd8\u4e0d\u662f\u5177\u4f53\u5143\u7d20\u3002\u8981\u518d\u8d70\u4e00\u6b65 *(*(p&#043;i)&#043;j) \u624d\u5230\u7ec8\u70b9\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u5b57\u7b26\u578b\u4e8c\u7ef4\u6570\u7ec4\u548c\u6307\u9488\u6570\u7ec4\u6df7\u7528<\/td>\n<td>char s[5][10] \u9700\u8981 char (*p)[10]&#xff1b;char *s[5] \u9700\u8981 char **p&#xff0c;\u4e24\u8005\u5185\u5b58\u5e03\u5c40\u5b8c\u5168\u4e0d\u540c\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u4e0d\u6e05\u695a *(*(p&#043;i)&#043;j) \u7b49\u4ef7\u4e8e p[i][j]<\/td>\n<td>\u5b9e\u9645\u7f16\u7801\u65f6\u53ef\u4ee5\u7528\u4e0b\u6807\u7b80\u5316&#xff0c;\u4f46\u7406\u89e3\u6307\u9488\u89e3\u5f15\u7528\u94fe\u624d\u80fd\u641e\u61c2\u4e8c\u7ef4\u6570\u7ec4\u4e0e\u6307\u9488\u7684\u5bf9\u5e94\u5173\u7cfb\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>8. \u4eca\u65e5\u5b66\u4e60\u611f\u609f<\/h3>\n<p>\u4eca\u5929\u6700\u723d\u7684\u4e00\u523b&#xff0c;\u4e0d\u662f\u5199\u51fa\u4e86 int (*p)[4] \u8fd9\u4e2a\u58f0\u660e&#xff0c;\u800c\u662f\u6211\u7ec8\u4e8e\u80fd\u4ece\u91cc\u5f80\u5916\u8bfb\u61c2\u5b83\u4e86\u3002\u4ee5\u524d\u770b\u5230\u8fd9\u79cd\u5e26\u62ec\u53f7\u7684\u58f0\u660e&#xff0c;\u5fc3\u91cc\u5c31\u53d1\u6035&#xff0c;\u53ea\u6562\u590d\u5236\u7c98\u8d34\u6539\u6539\u3002\u4eca\u5929\u8ddf\u7740\u62a5\u9519\u4e00\u6b65\u6b65\u63a8\u5bfc&#xff0c;\u4ece a[0] \u7684\u7c7b\u578b\u63a8\u5230 int[4]*&#xff0c;\u518d\u63a8\u5230 int (*p)[4]&#xff0c;\u8fd9\u4e2a\u62ec\u53f7\u5728\u6211\u773c\u91cc\u7ec8\u4e8e\u4e0d\u518d\u662f\u4e71\u7801&#xff0c;\u800c\u662f\u4e00\u4e2a\u6709\u903b\u8f91\u7684&#034;\u6307\u5411\u6570\u7ec4\u7684\u58f0\u660e\u7ed3\u6784&#034;\u3002\u8fd9\u79cd\u4ece&#034;\u6b7b\u8bb0&#034;\u5230&#034;\u7406\u89e3&#034;\u7684\u8f6c\u53d8&#xff0c;\u53ef\u80fd\u5c31\u662f\u5b66 C \u8bed\u8a00\u6700\u4e0a\u763e\u7684\u65f6\u523b\u3002<\/p>\n<p>*Day13 \u5b66\u4e60\u8bb0\u5f55&#xff0c;\u660e\u5929\u7ee7\u7eed\u3002*<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u4e00\u4e2a\u7f16\u8bd1\u5668\u7684\\&#8221;\u5acc\u5f03\\&#8221;\u81ea\u4ece\u6628\u5929&#xff08;Day12&#xff09;\u641e\u61c2\u4e86 int *p  a; \u80fd\u904d\u5386\u4e00\u7ef4\u6570\u7ec4&#xff0c;\u6211\u4eca\u5929\u5c31\u6709\u70b9\\&#8221;\u98d8\u4e86\\&#8221;\u3002\u7ec3\u4e60\u65f6\u9047\u5230\u4e00\u4e2a int a[3][4]&#xff0c;\u6211\u60f3\u90fd\u6ca1\u60f3&#xff0c;\u4e0b\u610f\u8bc6\u5c31\u6572\u51fa\u4e86\u540c\u4e00\u62db&#xff1a;int a[3][4]  {1,2,3,4,5,6,7,8,9,10,11,12};<br \/>\nint *p  a;  \/\/ \u6628\u5929\u4e0d\u90fd\u8fd9\u4e48\u7528\u5417&#xff1f;\u6ca1\u95ee\u9898\u5427&#xff1f;\u7ed3\u679c&#xff0c;\u7f16\u8bd1\u5668\\&#8221;\u556a\\&#8221;\u4e00<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9126,174,190,305],"topic":[],"class_list":["post-87161","post","type-post","status-publish","format-standard","hentry","category-server","tag-9126","tag-c","tag-190","tag-305"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/87161.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u4e00\u4e2a\u7f16\u8bd1\u5668\u7684&quot;\u5acc\u5f03&quot;\u81ea\u4ece\u6628\u5929&#xff08;Day12&#xff09;\u641e\u61c2\u4e86 int *p a; \u80fd\u904d\u5386\u4e00\u7ef4\u6570\u7ec4&#xff0c;\u6211\u4eca\u5929\u5c31\u6709\u70b9&quot;\u98d8\u4e86&quot;\u3002\u7ec3\u4e60\u65f6\u9047\u5230\u4e00\u4e2a int a[3][4]&#xff0c;\u6211\u60f3\u90fd\u6ca1\u60f3&#xff0c;\u4e0b\u610f\u8bc6\u5c31\u6572\u51fa\u4e86\u540c\u4e00\u62db&#xff1a;int a[3][4] {1,2,3,4,5,6,7,8,9,10,11,12}; int *p a; \/\/ \u6628\u5929\u4e0d\u90fd\u8fd9\u4e48\u7528\u5417&#xff1f;\u6ca1\u95ee\u9898\u5427&#xff1f;\u7ed3\u679c&#xff0c;\u7f16\u8bd1\u5668&quot;\u556a&quot;\u4e00\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/87161.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-29T14:48:31+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87161.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/87161.html\",\"name\":\"\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-29T14:48:31+00:00\",\"dateModified\":\"2026-07-29T14:48:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/87161.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/87161.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87161.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/87161.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u4e00\u4e2a\u7f16\u8bd1\u5668\u7684\"\u5acc\u5f03\"\u81ea\u4ece\u6628\u5929&#xff08;Day12&#xff09;\u641e\u61c2\u4e86 int *p a; \u80fd\u904d\u5386\u4e00\u7ef4\u6570\u7ec4&#xff0c;\u6211\u4eca\u5929\u5c31\u6709\u70b9\"\u98d8\u4e86\"\u3002\u7ec3\u4e60\u65f6\u9047\u5230\u4e00\u4e2a int a[3][4]&#xff0c;\u6211\u60f3\u90fd\u6ca1\u60f3&#xff0c;\u4e0b\u610f\u8bc6\u5c31\u6572\u51fa\u4e86\u540c\u4e00\u62db&#xff1a;int a[3][4] {1,2,3,4,5,6,7,8,9,10,11,12}; int *p a; \/\/ \u6628\u5929\u4e0d\u90fd\u8fd9\u4e48\u7528\u5417&#xff1f;\u6ca1\u95ee\u9898\u5427&#xff1f;\u7ed3\u679c&#xff0c;\u7f16\u8bd1\u5668\"\u556a\"\u4e00","og_url":"https:\/\/www.wsisp.com\/helps\/87161.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-29T14:48:31+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/87161.html","url":"https:\/\/www.wsisp.com\/helps\/87161.html","name":"\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-29T14:48:31+00:00","dateModified":"2026-07-29T14:48:31+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/87161.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/87161.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/87161.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4e8c\u7ef4\u6570\u7ec4\u7528int *p\u4e3a\u4ec0\u4e48\u4e0d\u884c\uff1f\u90a3\u4e2a\u62ec\u53f7\u5230\u5e95\u600e\u4e48\u8bfb\uff1f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=87161"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87161\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=87161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=87161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=87161"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=87161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}