{"id":111654,"date":"2026-10-01T14:16:50","date_gmt":"2026-10-01T06:16:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/111654.html"},"modified":"2026-10-01T14:16:50","modified_gmt":"2026-10-01T06:16:50","slug":"c-%e7%ac%ac-15-%e8%af%be%ef%bc%9a%e6%8c%87%e9%92%88-%e5%92%8c%e5%9c%b0%e5%9d%80","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/111654.html","title":{"rendered":"C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp;"},"content":{"rendered":"<p>\u4e0a\u4e00\u8bfe\u6807\u51c6\u7b54\u6848&#xff1a;<\/p>\n<li>\u6700\u7ec8\u8f93\u51fa&#xff1a;<\/li>\n<p>20<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>void change(int&amp; a)<\/p>\n<p>\u4e2d\u7684 a \u662f x \u7684\u5f15\u7528&#xff0c;\u4fee\u6539 a \u5c31\u662f\u5728\u4fee\u6539\u539f\u6765\u7684 x\u3002<\/p>\n<li><\/li>\n<p>x &#061; 30<br \/>\ny &#061; 30<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>int&amp; y &#061; x;<\/p>\n<p>\u8868\u793a y \u662f x \u7684\u522b\u540d&#xff0c;\u5b83\u4eec\u5bf9\u5e94\u540c\u4e00\u4e2a\u53d8\u91cf\u3002<\/p>\n<li>\u672c\u8d28\u533a\u522b&#xff1a;<\/li>\n<p>void test(int a)<\/p>\n<p>\u662f\u503c\u4f20\u9012&#xff1a;<\/p>\n<p>\u628a\u539f\u53d8\u91cf\u7684\u503c\u590d\u5236\u4e00\u4efd\u7ed9 a&#xff0c;\u4fee\u6539 a \u4e0d\u5f71\u54cd\u539f\u53d8\u91cf\u3002<\/p>\n<p>\u800c&#xff1a;<\/p>\n<p>void test(int&amp; a)<\/p>\n<p>\u662f\u5f15\u7528\u4f20\u9012&#xff1a;<\/p>\n<p>a \u76f4\u63a5\u5f15\u7528\u539f\u53d8\u91cf&#xff0c;\u4fee\u6539 a \u4f1a\u4fee\u6539\u539f\u53d8\u91cf\u3002<\/p>\n<li>\u6700\u540e&#xff1a;<\/li>\n<p>joint1 &#061; 0.0<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>setZero(joint1);<\/p>\n<p>\u628a joint1 \u901a\u8fc7\u5f15\u7528\u4f20\u8fdb\u51fd\u6570&#xff0c;\u51fd\u6570\u91cc\u7684&#xff1a;<\/p>\n<p>angle &#061; 0.0;<\/p>\n<p>\u76f4\u63a5\u4fee\u6539\u4e86 joint1\u3002<\/p>\n<hr \/>\n<h2>\u7b2c 15 \u8bfe&#xff1a;\u6307\u9488 * \u4e0e\u5730\u5740 &amp;<\/h2>\n<p>\u8fd9\u8282\u662f C&#043;&#043; \u91cc\u7b2c\u4e00\u4e2a\u771f\u6b63\u5bb9\u6613\u7ed5\u6655\u4eba\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n<p>\u4f46\u6211\u4eec\u4e0d\u80cc\u5b9a\u4e49\u3002<\/p>\n<p>\u6211\u4eec\u5148\u56de\u7b54\u4e00\u4e2a\u6700\u57fa\u7840\u7684\u95ee\u9898&#xff1a;<\/p>\n<p>\u53d8\u91cf\u5230\u5e95\u653e\u5728\u54ea\u91cc&#xff1f;<\/p>\n<hr \/>\n<h2>1. int x &#061; 5; \u5230\u5e95\u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f;<\/h2>\n<p>\u4f60\u73b0\u5728\u5df2\u7ecf\u77e5\u9053&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>\u53ef\u4ee5\u7c97\u7565\u7406\u89e3\u6210&#xff1a;<\/p>\n<p>x<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502  5  \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u4f46\u8fd9\u4e2a\u201c\u76d2\u5b50\u201d\u5b9e\u9645\u4e0a\u4e0d\u662f\u51ed\u7a7a\u5b58\u5728\u7684\u3002<\/p>\n<p>\u5b83\u8981\u653e\u5728\u7535\u8111\u7684&#xff1a;<\/p>\n<p>\u5185\u5b58 RAM<\/p>\n<p>\u91cc\u9762\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u628a\u5185\u5b58\u60f3\u8c61\u6210\u4e00\u6392\u975e\u5e38\u975e\u5e38\u591a\u7684\u5c0f\u623f\u95f4\u3002<\/p>\n<p>\u5185\u5b58<\/p>\n<p>\u5730\u57401000     \u5730\u57401004     \u5730\u57401008     \u5730\u57401012<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502      \u2502    \u2502      \u2502    \u2502      \u2502    \u2502      \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u6bcf\u4e00\u5757\u4f4d\u7f6e\u90fd\u6709\u81ea\u5df1\u7684&#xff1a;<\/p>\n<p>\u5730\u5740<\/p>\n<p>\u5c31\u50cf\u73b0\u5b9e\u4e2d\u7684\u623f\u5b50\u6709\u95e8\u724c\u53f7\u3002<\/p>\n<hr \/>\n<h2>2. \u53d8\u91cf\u540d\u548c\u5730\u5740\u4e0d\u662f\u4e00\u56de\u4e8b<\/h2>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>\u7535\u8111\u53ef\u80fd\u628a x \u653e\u5728\u67d0\u4e2a\u5185\u5b58\u4f4d\u7f6e\u3002<\/p>\n<p>\u6bd4\u5982\u4e3a\u4e86\u7406\u89e3&#xff0c;\u6211\u4eec\u5047\u8bbe&#xff1a;<\/p>\n<p>\u53d8\u91cf\u540d&#xff1a;x<\/p>\n<p>\u5185\u5b58\u5730\u5740&#xff1a;1000<\/p>\n<p>\u5185\u5bb9&#xff1a;5<\/p>\n<p>\u90a3\u4e48\u53ef\u4ee5\u753b&#xff1a;<\/p>\n<p>        x<br \/>\n        \u2193<br \/>\n\u5730\u5740 1000<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502    5     \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u8fd9\u91cc&#xff1a;<\/p>\n<p>x<\/p>\n<p>\u662f\u4f60\u7ed9\u53d8\u91cf\u8d77\u7684\u540d\u5b57\u3002<\/p>\n<p>\u800c&#xff1a;<\/p>\n<p>1000<\/p>\n<p>\u662f\u5b83\u771f\u6b63\u4f4d\u4e8e\u5185\u5b58\u4e2d\u7684\u5730\u5740\u3002<\/p>\n<p>\u73b0\u5b9e\u7a0b\u5e8f\u91cc\u7684\u5730\u5740\u4e0d\u4f1a\u8fd9\u4e48\u7b80\u5355&#xff0c;\u53ef\u80fd\u957f\u5f97\u50cf&#xff1a;<\/p>\n<p>0x7ffd1234abcd<\/p>\n<p>\u73b0\u5728\u5148\u4e0d\u7528\u7ba1\u3002<\/p>\n<hr \/>\n<h2>3. \u5730\u5740\u5c31\u50cf\u95e8\u724c\u53f7<\/h2>\n<p>\u8fd9\u662f\u7406\u89e3\u6307\u9488\u6700\u597d\u7684\u7c7b\u6bd4\u4e4b\u4e00\u3002<\/p>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>\u676d\u5dde\u67d0\u5c0f\u533a 3\u680b502\u5ba4<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5730\u5740\u3002<\/p>\n<p>\u623f\u95f4\u91cc\u9762\u4f4f\u7740\u4e00\u4e2a\u4eba\u3002<\/p>\n<p>\u5bf9\u5e94 C&#043;&#043;&#xff1a;<\/p>\n<p>\u5730\u5740<br \/>\n\u2193<br \/>\n\u5185\u5b58\u4e2d\u7684\u4f4d\u7f6e<\/p>\n<p>\u503c<br \/>\n\u2193<br \/>\n\u8fd9\u4e2a\u4f4d\u7f6e\u91cc\u9762\u5b58\u653e\u7684\u6570\u636e<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>\u53ef\u4ee5\u60f3\u6210&#xff1a;<\/p>\n<p>\u95e8\u724c\u53f7&#xff1a;1000<br \/>\n\u623f\u95f4\u5185\u5bb9&#xff1a;5<\/p>\n<hr \/>\n<h2>4. \u600e\u4e48\u77e5\u9053 x \u7684\u5730\u5740&#xff1f;<\/h2>\n<p>C&#043;&#043; \u53ef\u4ee5\u5199&#xff1a;<\/p>\n<p>&amp;x<\/p>\n<p>\u6ce8\u610f&#xff1a;<\/p>\n<p>\u8fd9\u91cc\u7684&#xff1a;<\/p>\n<p>&amp;<\/p>\n<p>\u548c\u4e0a\u4e00\u8bfe\u7684&#xff1a;<\/p>\n<p>int&amp; y &#061; x;<\/p>\n<p>\u867d\u7136\u7b26\u53f7\u4e00\u6837&#xff0c;\u4f46\u4f4d\u7f6e\u4e0d\u540c&#xff0c;\u610f\u4e49\u4e5f\u4e0d\u540c\u3002<\/p>\n<p>\u8fd9\u91cc&#xff1a;<\/p>\n<p>&amp;x<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>\u53d6\u5f97\u53d8\u91cf x \u7684\u5730\u5740\u3002<\/p>\n<hr \/>\n<h2>5. \u770b\u4e00\u4e2a\u7a0b\u5e8f<\/h2>\n<p>#include &lt;iostream&gt;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int x &#061; 5;<\/p>\n<p>    std::cout &lt;&lt; x &lt;&lt; std::endl;<br \/>\n    std::cout &lt;&lt; &amp;x &lt;&lt; std::endl;<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\u7b2c\u4e00\u53e5&#xff1a;<\/p>\n<p>std::cout &lt;&lt; x &lt;&lt; std::endl;<\/p>\n<p>\u8f93\u51fa\u7684\u662f&#xff1a;<\/p>\n<p>5<\/p>\n<p>\u7b2c\u4e8c\u53e5&#xff1a;<\/p>\n<p>std::cout &lt;&lt; &amp;x &lt;&lt; std::endl;<\/p>\n<p>\u8f93\u51fa\u7684\u662f&#xff1a;<\/p>\n<p>x \u5728\u5185\u5b58\u4e2d\u7684\u5730\u5740\u3002<\/p>\n<p>\u4f60\u53ef\u80fd\u770b\u5230\u7c7b\u4f3c&#xff1a;<\/p>\n<p>0x7ffdf2817a4c<\/p>\n<p>\u6bcf\u6b21\u8fd0\u884c\u751a\u81f3\u53ef\u80fd\u4e0d\u4e00\u6837\u3002<\/p>\n<p>\u73b0\u5728\u4e0d\u9700\u8981\u89e3\u91ca\u4e3a\u4ec0\u4e48\u3002<\/p>\n<hr \/>\n<h2>6. \u4e24\u79cd &amp; \u5343\u4e07\u5148\u5206\u5f00<\/h2>\n<p>\u76ee\u524d\u4f60\u9047\u5230\u4e24\u79cd&#xff1a;<\/p>\n<h4>\u7b2c\u4e00\u79cd<\/h4>\n<p>int&amp; y &#061; x;<\/p>\n<p>\u8fd9\u91cc&#xff1a;<\/p>\n<p>&amp;<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>y \u662f\u4e00\u4e2a\u5f15\u7528\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u79cd<\/h4>\n<p>&amp;x<\/p>\n<p>\u8fd9\u91cc&#xff1a;<\/p>\n<p>&amp;<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>\u53d6\u5f97 x \u7684\u5730\u5740\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u5148\u6839\u636e\u4f4d\u7f6e\u533a\u5206&#xff1a;<\/p>\n<p>int&amp; y<br \/>\n    \u2191<br \/>\n\u58f0\u660e\u5f15\u7528<\/p>\n<p>&amp;x<br \/>\n\u2191<br \/>\n\u83b7\u53d6\u5730\u5740<\/p>\n<p>\u4ee5\u540e\u4f1a\u9010\u6e10\u4e60\u60ef\u3002<\/p>\n<hr \/>\n<h2>7. \u90a3\u201c\u6307\u9488\u201d\u662f\u4ec0\u4e48&#xff1f;<\/h2>\n<p>\u7ec8\u4e8e\u5230\u4e86\u6838\u5fc3\u3002<\/p>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>\u800c&#xff1a;<\/p>\n<p>&amp;x<\/p>\n<p>\u80fd\u83b7\u5f97 x \u7684\u5730\u5740\u3002<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u80fd\u4e0d\u80fd\u521b\u5efa\u4e00\u4e2a\u53d8\u91cf&#xff0c;\u4e13\u95e8\u4fdd\u5b58\u8fd9\u4e2a\u5730\u5740&#xff1f;<\/p>\n<p>\u53ef\u4ee5\u3002<\/p>\n<p>\u8fd9\u5c31\u662f&#xff1a;<\/p>\n<p>\u6307\u9488 pointer<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>int* p &#061; &amp;x;<\/p>\n<p>\u7b2c\u4e00\u6b21\u770b\u5230\u5f88\u602a\u3002<\/p>\n<p>\u6211\u4eec\u4e00\u70b9\u70b9\u62c6\u3002<\/p>\n<hr \/>\n<h2>8. int* p &#061; &amp;x;<\/h2>\n<p>\u5148\u770b\u53f3\u8fb9&#xff1a;<\/p>\n<p>&amp;x<\/p>\n<p>\u610f\u601d&#xff1a;<\/p>\n<p>x \u7684\u5730\u5740\u3002<\/p>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>&amp;x &#061; 1000<\/p>\n<p>\u7136\u540e&#xff1a;<\/p>\n<p>int* p<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u6307\u9488\u53d8\u91cf&#xff0c;\u540d\u5b57\u53eb p\u3002<\/p>\n<p>\u5b83\u7528\u6765\u4fdd\u5b58&#xff1a;<\/p>\n<p>\u4e00\u4e2a int \u7c7b\u578b\u53d8\u91cf\u7684\u5730\u5740\u3002<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>int* p &#061; &amp;x;<\/p>\n<p>\u53ef\u4ee5\u7ffb\u8bd1\u6210&#xff1a;<\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u6307\u5411 int \u7684\u6307\u9488 p&#xff0c;\u8ba9\u5b83\u4fdd\u5b58 x \u7684\u5730\u5740\u3002<\/p>\n<hr \/>\n<h2>9. \u753b\u51fa\u6765\u5c31\u975e\u5e38\u76f4\u89c2\u4e86<\/h2>\n<p>int x &#061; 5;<br \/>\nint* p &#061; &amp;x;<\/p>\n<p>\u53ef\u4ee5\u60f3\u6210&#xff1a;<\/p>\n<p>x<br \/>\n\u5730\u57401000<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502  5  \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n   \u25b2<br \/>\n   \u2502<br \/>\n   \u2502 p\u91cc\u9762\u5b58\u77401000<br \/>\n   \u2502<br \/>\np<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 1000 \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff1a;<\/p>\n<p>p<\/p>\n<p>\u4e0d\u662f\u5b58 5\u3002<\/p>\n<p>\u800c\u662f\u5b58&#xff1a;<\/p>\n<p>x \u5728\u54ea\u91cc\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u6307\u9488\u3002<\/p>\n<hr \/>\n<h2>10. \u4e00\u53e5\u8bdd\u7406\u89e3\u6307\u9488<\/h2>\n<p>\u6307\u9488\u5c31\u662f\u4e00\u4e2a\u4e13\u95e8\u4fdd\u5b58\u5185\u5b58\u5730\u5740\u7684\u53d8\u91cf\u3002<\/p>\n<p>\u666e\u901a\u53d8\u91cf&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>\u91cc\u9762\u653e&#xff1a;<\/p>\n<p>5<\/p>\n<p>\u6307\u9488\u53d8\u91cf&#xff1a;<\/p>\n<p>int* p &#061; &amp;x;<\/p>\n<p>\u91cc\u9762\u653e&#xff1a;<\/p>\n<p>x \u7684\u5730\u5740<\/p>\n<hr \/>\n<h2>11. * \u53c8\u662f\u4ec0\u4e48&#xff1f;<\/h2>\n<p>\u73b0\u5728\u51fa\u73b0\u7b2c\u4e8c\u4e2a\u6838\u5fc3\u7b26\u53f7&#xff1a;<\/p>\n<p>*p<\/p>\n<p>\u5982\u679c&#xff1a;<\/p>\n<p>p<\/p>\n<p>\u91cc\u9762\u5b58\u7684\u662f x \u7684\u5730\u5740&#xff0c;\u90a3\u4e48&#xff1a;<\/p>\n<p>*p<\/p>\n<p>\u610f\u601d\u5c31\u662f&#xff1a;<\/p>\n<p>\u6839\u636e p \u4fdd\u5b58\u7684\u5730\u5740&#xff0c;\u627e\u5230\u90a3\u4e2a\u4f4d\u7f6e\u91cc\u9762\u7684\u6570\u636e\u3002<\/p>\n<p>\u8fd9\u4e2a\u64cd\u4f5c\u53eb&#xff1a;<\/p>\n<p>\u89e3\u5f15\u7528 dereference<\/p>\n<p>\u6682\u65f6\u4e0d\u7528\u80cc\u82f1\u6587\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u628a&#xff1a;<\/p>\n<p>*p<\/p>\n<p>\u7406\u89e3\u6210&#xff1a;<\/p>\n<p>\u201c\u987a\u7740 p \u627e\u8fc7\u53bb&#xff0c;\u770b\u770b\u91cc\u9762\u662f\u4ec0\u4e48\u3002\u201d<\/p>\n<hr \/>\n<h2>12. \u4e3e\u4f8b<\/h2>\n<p>int x &#061; 5;<\/p>\n<p>int* p &#061; &amp;x;<\/p>\n<p>\u73b0\u5728&#xff1a;<\/p>\n<p>p \u5b58\u7740 x \u7684\u5730\u5740<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>*p<\/p>\n<p>\u5c31\u662f&#xff1a;<\/p>\n<p>5<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>std::cout &lt;&lt; *p &lt;&lt; std::endl;<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>5<\/p>\n<hr \/>\n<h2>13. \u73b0\u5728\u6211\u4eec\u6709\u4e09\u4e2a\u4e0d\u540c\u7684\u4e1c\u897f<\/h2>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>int x &#061; 5;<br \/>\nint* p &#061; &amp;x;<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>x<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>x \u91cc\u9762\u7684\u503c<\/p>\n<p>\u4e5f\u5c31\u662f&#xff1a;<\/p>\n<p>5<\/p>\n<hr \/>\n<p>&amp;x<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>x \u7684\u5730\u5740<\/p>\n<p>\u4f8b\u5982\u5047\u8bbe&#xff1a;<\/p>\n<p>1000<\/p>\n<hr \/>\n<p>p<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>p \u91cc\u9762\u4fdd\u5b58\u7684\u5185\u5bb9<\/p>\n<p>\u800c p \u4fdd\u5b58\u7684\u5c31\u662f&#xff1a;<\/p>\n<p>1000<\/p>\n<hr \/>\n<p>*p<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>\u53bb p \u6307\u5411\u7684\u4f4d\u7f6e\u53d6\u503c<\/p>\n<p>\u4e8e\u662f\u5f97\u5230&#xff1a;<\/p>\n<p>5<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>x   \u2192 5<\/p>\n<p>&amp;x  \u2192 1000<\/p>\n<p>p   \u2192 1000<\/p>\n<p>*p  \u2192 5<\/p>\n<p>\u8fd9\u662f\u672c\u8bfe\u6700\u6838\u5fc3\u7684\u5173\u7cfb\u3002<\/p>\n<hr \/>\n<h2>14. \u4e3a\u4ec0\u4e48 *p \u80fd\u4fee\u6539 x&#xff1f;<\/h2>\n<p>\u770b&#xff1a;<\/p>\n<p>int x &#061; 5;<br \/>\nint* p &#061; &amp;x;<\/p>\n<p>*p &#061; 100;<\/p>\n<p>\u8fd9\u91cc&#xff1a;<\/p>\n<p>*p<\/p>\n<p>\u6307\u7684\u662f&#xff1a;<\/p>\n<p>p \u6307\u5411\u7684\u90a3\u4e2a\u53d8\u91cf\u3002<\/p>\n<p>\u800c p \u6307\u5411&#xff1a;<\/p>\n<p>x<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>*p &#061; 100;<\/p>\n<p>\u5b9e\u9645\u4e0a\u5c31\u662f&#xff1a;<\/p>\n<p>x &#061; 100;<\/p>\n<p>\u6700\u7ec8&#xff1a;<\/p>\n<p>x &#061; 100<\/p>\n<hr \/>\n<h2>15. \u56fe\u793a\u7406\u89e3<\/h2>\n<p>\u5f00\u59cb&#xff1a;<\/p>\n<p>p<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 1000 \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n    \u2502<br \/>\n    \u25bc<\/p>\n<p>\u5730\u57401000<br \/>\nx<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502  5   \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p>*p &#061; 100;<\/p>\n<p>\u610f\u601d&#xff1a;<\/p>\n<p>\u987a\u7740 p \u627e\u5230\u5730\u5740 1000&#xff0c;\u628a\u90a3\u4e2a\u4f4d\u7f6e\u7684\u5185\u5bb9\u6539\u6210 100\u3002<\/p>\n<p>\u4e8e\u662f&#xff1a;<\/p>\n<p>p<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 1000 \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n    \u2502<br \/>\n    \u25bc<\/p>\n<p>x<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 100  \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<hr \/>\n<h2>16. \u5b8c\u6574\u7a0b\u5e8f<\/h2>\n<p>#include &lt;iostream&gt;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int x &#061; 5;<\/p>\n<p>    int* p &#061; &amp;x;<\/p>\n<p>    std::cout &lt;&lt; x &lt;&lt; std::endl;<br \/>\n    std::cout &lt;&lt; *p &lt;&lt; std::endl;<\/p>\n<p>    *p &#061; 100;<\/p>\n<p>    std::cout &lt;&lt; x &lt;&lt; std::endl;<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>5<br \/>\n5<br \/>\n100<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1f;<\/p>\n<p>\u7b2c\u4e00\u6b21&#xff1a;<\/p>\n<p>std::cout &lt;&lt; x;<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>5<\/p>\n<p>\u7b2c\u4e8c\u6b21&#xff1a;<\/p>\n<p>std::cout &lt;&lt; *p;<\/p>\n<p>\u56e0\u4e3a p \u6307\u5411 x&#xff0c;\u6240\u4ee5\u4e5f\u662f&#xff1a;<\/p>\n<p>5<\/p>\n<p>\u7136\u540e&#xff1a;<\/p>\n<p>*p &#061; 100;<\/p>\n<p>\u76f4\u63a5\u4fee\u6539 x\u3002<\/p>\n<p>\u6700\u540e\u8f93\u51fa&#xff1a;<\/p>\n<p>100<\/p>\n<hr \/>\n<h2>17. \u6307\u9488\u548c\u5f15\u7528\u662f\u4e0d\u662f\u5f88\u50cf&#xff1f;<\/h2>\n<p>\u975e\u5e38\u50cf\u3002<\/p>\n<p>\u5f15\u7528&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>int&amp; ref &#061; x;<\/p>\n<p>ref &#061; 100;<\/p>\n<p>\u7ed3\u679c&#xff1a;<\/p>\n<p>x &#061; 100<\/p>\n<p>\u6307\u9488&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>int* p &#061; &amp;x;<\/p>\n<p>*p &#061; 100;<\/p>\n<p>\u7ed3\u679c\u540c\u6837&#xff1a;<\/p>\n<p>x &#061; 100<\/p>\n<p>\u6240\u4ee5\u4f60\u53ef\u80fd\u95ee&#xff1a;<\/p>\n<p>\u90a3\u4e3a\u4ec0\u4e48\u8fd8\u8981\u4e24\u79cd&#xff1f;<\/p>\n<p>\u975e\u5e38\u597d\u7684\u95ee\u9898\u3002<\/p>\n<p>\u73b0\u5728\u5148\u4e0d\u6df1\u5165&#xff0c;\u5148\u5efa\u7acb\u6700\u7b80\u5355\u533a\u522b\u3002<\/p>\n<hr \/>\n<h2>18. \u5f15\u7528\u66f4\u50cf\u201c\u522b\u540d\u201d<\/h2>\n<p>int&amp; ref &#061; x;<\/p>\n<p>\u53ef\u4ee5\u7406\u89e3\u6210&#xff1a;<\/p>\n<p>x \u548c ref \u662f\u540c\u4e00\u4e2a\u4e1c\u897f\u7684\u4e24\u4e2a\u540d\u5b57<\/p>\n<p>\u4ee5\u540e\u6b63\u5e38\u4f7f\u7528&#xff1a;<\/p>\n<p>ref &#061; 10;<\/p>\n<p>\u4e0d\u9700\u8981\u7279\u6b8a\u7b26\u53f7\u3002<\/p>\n<hr \/>\n<h2>19. \u6307\u9488\u66f4\u50cf\u201c\u5730\u5740\u7eb8\u6761\u201d<\/h2>\n<p>int* p &#061; &amp;x;<\/p>\n<p>p \u81ea\u5df1\u662f\u4e00\u4e2a\u53d8\u91cf\u3002<\/p>\n<p>\u91cc\u9762\u4fdd\u5b58&#xff1a;<\/p>\n<p>x \u7684\u5730\u5740\u3002<\/p>\n<p>\u5982\u679c\u60f3\u64cd\u4f5c x&#xff1a;<\/p>\n<p>*p<\/p>\n<p>\u9700\u8981\u5148\u201c\u987a\u7740\u5730\u5740\u627e\u8fc7\u53bb\u201d\u3002<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u5f15\u7528<br \/>\n\u2248 \u522b\u540d<\/p>\n<p>\u6307\u9488<br \/>\n\u2248 \u4fdd\u5b58\u5730\u5740\u7684\u53d8\u91cf<\/p>\n<hr \/>\n<h2>20. \u7528\u73b0\u5b9e\u5730\u5740\u7c7b\u6bd4<\/h2>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>x &#061; \u4e00\u53f0\u673a\u68b0\u81c2<\/p>\n<p>\u5f15\u7528&#xff1a;<\/p>\n<p>ref<\/p>\n<p>\u76f8\u5f53\u4e8e&#xff1a;<\/p>\n<p>\u7ed9\u8fd9\u53f0\u673a\u68b0\u81c2\u8d77\u4e86\u53e6\u4e00\u4e2a\u540d\u5b57\u3002<\/p>\n<hr \/>\n<p>\u6307\u9488&#xff1a;<\/p>\n<p>p<\/p>\n<p>\u76f8\u5f53\u4e8e\u4f60\u624b\u91cc\u6709\u4e00\u5f20\u7eb8&#xff1a;<\/p>\n<p>\u201c\u673a\u68b0\u81c2\u5728 3\u53f7\u5b9e\u9a8c\u5ba4\u201d<\/p>\n<p>\u8fd9\u4e2a\u7eb8\u6761\u4e0d\u662f\u673a\u68b0\u81c2\u672c\u8eab\u3002<\/p>\n<p>\u5b83\u53ea\u662f\u544a\u8bc9\u4f60&#xff1a;<\/p>\n<p>\u53bb\u54ea\u91cc\u627e\u5230\u673a\u68b0\u81c2\u3002<\/p>\n<p>\u7136\u540e&#xff1a;<\/p>\n<p>*p<\/p>\n<p>\u5c31\u76f8\u5f53\u4e8e&#xff1a;<\/p>\n<p>\u6309\u7eb8\u6761\u4e0a\u7684\u5730\u5740\u627e\u5230\u673a\u68b0\u81c2\u672c\u4f53\u3002<\/p>\n<hr \/>\n<h2>21. int* p \u91cc\u7684 * \u548c *p \u53c8\u6709\u533a\u522b<\/h2>\n<p>\u8fd9\u4e5f\u662f\u521d\u5b66\u8005\u5bb9\u6613\u6df7\u7684\u5730\u65b9\u3002<\/p>\n<h4>\u58f0\u660e\u65f6&#xff1a;<\/h4>\n<p>int* p;<\/p>\n<p>\u8fd9\u91cc\u7684&#xff1a;<\/p>\n<p>*<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>p \u662f\u4e00\u4e2a\u6307\u9488\u53d8\u91cf\u3002<\/p>\n<hr \/>\n<h4>\u4f7f\u7528\u65f6&#xff1a;<\/h4>\n<p>*p<\/p>\n<p>\u8fd9\u91cc\u7684&#xff1a;<\/p>\n<p>*<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>\u8bbf\u95ee p \u6307\u5411\u7684\u90a3\u4e2a\u53d8\u91cf\u3002<\/p>\n<p>\u867d\u7136\u90fd\u662f *&#xff0c;\u4f46\u662f\u6240\u5728\u4f4d\u7f6e\u4e0d\u540c\u3002<\/p>\n<p>\u5148\u6839\u636e\u4e0a\u4e0b\u6587\u533a\u5206\u3002<\/p>\n<hr \/>\n<h2>22. \u73b0\u5728\u628a\u56db\u4e2a\u4e1c\u897f\u653e\u5728\u4e00\u8d77<\/h2>\n<p>int x &#061; 5;<br \/>\nint* p &#061; &amp;x;<\/p>\n<p>\u7262\u8bb0&#xff1a;<\/p>\n<p>x<br \/>\n\u2193<br \/>\n\u53d8\u91cf\u7684\u503c<br \/>\n5<\/p>\n<p>&amp;x<br \/>\n\u2193<br \/>\n\u53d8\u91cf\u7684\u5730\u5740<\/p>\n<p>p<br \/>\n\u2193<br \/>\np \u4fdd\u5b58\u7684\u5730\u5740<br \/>\n\u4e5f\u5c31\u662f &amp;x<\/p>\n<p>*p<br \/>\n\u2193<br \/>\np \u6307\u5411\u5730\u5740\u91cc\u7684\u503c<br \/>\n\u4e5f\u5c31\u662f x<br \/>\n\u4e5f\u5c31\u662f 5<\/p>\n<p>\u6240\u4ee5\u53ef\u4ee5\u8bb0\u6210&#xff1a;<\/p>\n<p>p &#061; &amp;x<\/p>\n<p>*p &#061; x<\/p>\n<p>\u8fd9\u662f\u975e\u5e38\u91cd\u8981\u7684\u4e00\u7ec4\u5173\u7cfb\u3002<\/p>\n<hr \/>\n<h2>23. \u6307\u9488\u600e\u4e48\u7528\u4e8e\u51fd\u6570&#xff1f;<\/h2>\n<p>\u4e0a\u4e00\u8bfe\u6211\u4eec\u7528\u5f15\u7528&#xff1a;<\/p>\n<p>void change(int&amp; a)<br \/>\n{<br \/>\n    a &#061; 100;<br \/>\n}<\/p>\n<p>\u6307\u9488\u4e5f\u80fd\u505a\u5230\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>void change(int* p)<br \/>\n{<br \/>\n    *p &#061; 100;<br \/>\n}<\/p>\n<p>\u8c03\u7528\u65f6&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>change(&amp;x);<\/p>\n<p>\u6ce8\u610f\u8fd9\u91cc\u4e0d\u518d\u4f20&#xff1a;<\/p>\n<p>x<\/p>\n<p>\u800c\u662f\u4f20&#xff1a;<\/p>\n<p>&amp;x<\/p>\n<p>\u4e5f\u5c31\u662f&#xff1a;<\/p>\n<p>x \u7684\u5730\u5740\u3002<\/p>\n<hr \/>\n<h2>24. \u4e00\u6b65\u4e00\u6b65\u770b<\/h2>\n<p>\u51fd\u6570&#xff1a;<\/p>\n<p>void change(int* p)<\/p>\n<p>\u8868\u793a&#xff1a;<\/p>\n<p>change \u9700\u8981\u63a5\u6536\u4e00\u4e2a int \u7684\u5730\u5740\u3002<\/p>\n<p>\u5916\u9762&#xff1a;<\/p>\n<p>int x &#061; 5;<\/p>\n<p>\u7136\u540e&#xff1a;<\/p>\n<p>change(&amp;x);<\/p>\n<p>\u628a&#xff1a;<\/p>\n<p>x \u7684\u5730\u5740<\/p>\n<p>\u4f20\u8fdb\u53bb\u3002<\/p>\n<p>\u4e8e\u662f\u51fd\u6570\u91cc\u7684&#xff1a;<\/p>\n<p>p<\/p>\n<p>\u4fdd\u5b58&#xff1a;<\/p>\n<p>x \u7684\u5730\u5740<\/p>\n<p>\u518d\u6267\u884c&#xff1a;<\/p>\n<p>*p &#061; 100;<\/p>\n<p>\u5c31\u662f&#xff1a;<\/p>\n<p>\u6839\u636e\u5730\u5740\u627e\u5230 x&#xff0c;\u628a\u5b83\u6539\u6210 100\u3002<\/p>\n<p>\u6240\u4ee5\u6700\u7ec8&#xff1a;<\/p>\n<p>x &#061; 100<\/p>\n<hr \/>\n<h2>25. \u5f15\u7528\u53c2\u6570\u548c\u6307\u9488\u53c2\u6570\u5bf9\u6bd4<\/h2>\n<h4>\u5f15\u7528<\/h4>\n<p>void change(int&amp; a)<br \/>\n{<br \/>\n    a &#061; 100;<br \/>\n}<\/p>\n<p>change(x);<\/p>\n<hr \/>\n<h4>\u6307\u9488<\/h4>\n<p>void change(int* p)<br \/>\n{<br \/>\n    *p &#061; 100;<br \/>\n}<\/p>\n<p>change(&amp;x);<\/p>\n<p>\u4e24\u8005\u90fd\u80fd\u4fee\u6539\u5916\u90e8\u7684 x\u3002<\/p>\n<p>\u4f46\u662f\u5199\u6cd5\u660e\u663e\u4e0d\u540c\u3002<\/p>\n<p>\u73b0\u5728\u5148\u8bb0\u4f4f\u7ed3\u6784&#xff0c;\u4e0d\u9700\u8981\u5224\u65ad\u201c\u54ea\u4e2a\u66f4\u597d\u201d\u3002<\/p>\n<p>\u540e\u9762\u968f\u7740\u5de5\u7a0b\u4ee3\u7801\u5b66\u4e60&#xff0c;\u6211\u4eec\u4f1a\u8bb2\u4f7f\u7528\u573a\u666f\u3002<\/p>\n<hr \/>\n<h2>26. \u673a\u5668\u4eba\u91cc\u4e3a\u4ec0\u4e48\u4f1a\u9047\u5230\u6307\u9488&#xff1f;<\/h2>\n<p>\u975e\u5e38\u591a\u3002<\/p>\n<p>\u6bd4\u5982\u4ee5\u540e\u4f60\u5904\u7406&#xff1a;<\/p>\n<p>\u4f20\u611f\u5668\u6570\u636e<br \/>\n\u56fe\u50cf<br \/>\n\u6570\u7ec4<br \/>\n\u52a8\u6001\u5185\u5b58<br \/>\nROS2\u6d88\u606f<br \/>\n\u8bbe\u5907\u9a71\u52a8<br \/>\n\u4e32\u53e3\u7f13\u5b58\u533a<br \/>\nCAN\u6570\u636e<\/p>\n<p>\u7ecf\u5e38\u4f1a\u51fa\u73b0\u5730\u5740\u3002<\/p>\n<p>\u4f8b\u5982\u4f60\u4ee5\u540e\u53ef\u80fd\u89c1&#xff1a;<\/p>\n<p>uint8_t* data;<\/p>\n<p>\u5b83\u5927\u6982\u610f\u601d\u5c31\u662f&#xff1a;<\/p>\n<p>data \u662f\u4e00\u4e2a\u6307\u9488&#xff0c;\u6307\u5411\u4e00\u5757 uint8_t \u6570\u636e\u3002<\/p>\n<p>\u6216\u8005 OpenCV\u3001\u5e95\u5c42\u9a71\u52a8\u7a0b\u5e8f\u91cc\u7ecf\u5e38\u4f1a\u6d89\u53ca&#xff1a;<\/p>\n<p>\u4e00\u5757\u8fde\u7eed\u5185\u5b58\u5230\u5e95\u5728\u54ea\u91cc\u3002<\/p>\n<p>\u6240\u4ee5\u6307\u9488\u662f C\/C&#043;&#043; \u5e95\u5c42\u7f16\u7a0b\u80fd\u529b\u7684\u6838\u5fc3\u3002<\/p>\n<hr \/>\n<h2>27. \u4f46\u4e3a\u4ec0\u4e48\u6307\u9488\u5bb9\u6613\u51fa\u95ee\u9898&#xff1f;<\/h2>\n<p>\u56e0\u4e3a\u6307\u9488\u4fdd\u5b58\u7684\u662f\u5730\u5740\u3002<\/p>\n<p>\u5982\u679c\u5730\u5740\u9519\u8bef&#xff1a;<\/p>\n<p>\u627e\u9519\u623f\u95f4<\/p>\n<p>\u4f60\u5c31\u53ef\u80fd\u8bbf\u95ee\u4e0d\u5c5e\u4e8e\u81ea\u5df1\u7684\u5185\u5b58\u3002<\/p>\n<p>\u8fd9\u4f1a\u5bfc\u81f4&#xff1a;<\/p>\n<p>\u7a0b\u5e8f\u5d29\u6e83<br \/>\n\u6570\u636e\u88ab\u7834\u574f<br \/>\nSegmentation fault<\/p>\n<p>\u6240\u4ee5\u4ee5\u540e\u6211\u4eec\u4f1a\u4e13\u95e8\u8bb2&#xff1a;<\/p>\n<p>nullptr<\/p>\n<p>\u4ee5\u53ca&#xff1a;<\/p>\n<p>\u7a7a\u6307\u9488\u3001\u91ce\u6307\u9488\u3001\u60ac\u7a7a\u6307\u9488<\/p>\n<p>\u4f46\u4eca\u5929\u4e0d\u8981\u4e00\u4e0b\u585e\u592a\u591a\u3002<\/p>\n<hr \/>\n<h2>28. \u4eca\u5929\u53ea\u638c\u63e1\u8fd9\u4e00\u5f20\u56fe<\/h2>\n<p>int x &#061; 5;<br \/>\nint* p &#061; &amp;x;<\/p>\n<p>\u5bf9\u5e94&#xff1a;<\/p>\n<p>           p<br \/>\n       \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n       \u2502 \u5730\u5740   \u2502<br \/>\n       \u2514\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2518<br \/>\n           \u2502<br \/>\n           \u25bc<br \/>\n           x<br \/>\n       \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n       \u2502   5    \u2502<br \/>\n       \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u5e76\u4e14&#xff1a;<\/p>\n<p>x   \u2192 5<\/p>\n<p>&amp;x  \u2192 x\u7684\u5730\u5740<\/p>\n<p>p   \u2192 x\u7684\u5730\u5740<\/p>\n<p>*p  \u2192 5<\/p>\n<p>\u5982\u679c\u628a\u8fd9\u4e2a\u771f\u6b63\u7406\u89e3&#xff0c;\u6307\u9488\u5c31\u8fc8\u8fc7\u7b2c\u4e00\u9053\u574e\u4e86\u3002<\/p>\n<hr \/>\n<h2>\u672c\u8bfe\u5c0f\u7ec3\u4e60<\/h2>\n<h4>\u7b2c 1 \u9898<\/h4>\n<p>int x &#061; 10;<\/p>\n<p>int* p &#061; &amp;x;<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>*p &#061; ?<\/p>\n<hr \/>\n<h4>\u7b2c 2 \u9898<\/h4>\n<p>int x &#061; 5;<br \/>\nint* p &#061; &amp;x;<\/p>\n<p>*p &#061; 20;<\/p>\n<p>\u6700\u540e&#xff1a;<\/p>\n<p>x &#061; ?<\/p>\n<hr \/>\n<h4>\u7b2c 3 \u9898<\/h4>\n<p>\u7528\u81ea\u5df1\u7684\u8bdd\u5206\u522b\u89e3\u91ca&#xff1a;<\/p>\n<p>&amp;x<\/p>\n<p>\u548c&#xff1a;<\/p>\n<p>*p<\/p>\n<hr \/>\n<h4 style=\"background-color:transparent\">\u7b2c 4 \u9898<\/h4>\n<p>\u4e0b\u9762\u4ee3\u7801&#xff1a;<\/p>\n<p>void change(int* p)<br \/>\n{<br \/>\n    *p &#061; 50;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int x &#061; 3;<\/p>\n<p>    change(&amp;x);<br \/>\n}<\/p>\n<p>\u6700\u540e&#xff1a;<\/p>\n<p>x &#061; ?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e00\u8bfe\u6807\u51c6\u7b54\u6848&#xff1a;\u6700\u7ec8\u8f93\u51fa&#xff1a;20\u56e0\u4e3a&#xff1a;void change(int&amp; a)\u4e2d\u7684 a \u662f x \u7684\u5f15\u7528&#xff0c;\u4fee\u6539 a \u5c31\u662f\u5728\u4fee\u6539\u539f\u6765\u7684 x\u3002x  30<br \/>\ny  30\u56e0\u4e3a&#xff1a;int&amp; y  x;\u8868\u793a y \u662f x \u7684\u522b\u540d&#xff0c;\u5b83\u4eec\u5bf9\u5e94\u540c\u4e00\u4e2a\u53d8\u91cf\u3002\u672c\u8d28\u533a\u522b&#xff1a;void test(int a)\u662f\u503c\u4f20\u9012&#xff1a;\u628a\u539f\u53d8\u91cf\u7684\u503c\u590d\u5236\u4e00\u4efd\u7ed9 a&#xff0c;\u4fee\u6539 a \u4e0d\u5f71\u54cd\u539f\u53d8\u91cf\u3002\u800c&#xff1a;voi<\/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":[55,190],"topic":[],"class_list":["post-111654","post","type-post","status-publish","format-standard","hentry","category-server","tag-c","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp; - \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\/111654.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp; - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e0a\u4e00\u8bfe\u6807\u51c6\u7b54\u6848&#xff1a;\u6700\u7ec8\u8f93\u51fa&#xff1a;20\u56e0\u4e3a&#xff1a;void change(int&amp; a)\u4e2d\u7684 a \u662f x \u7684\u5f15\u7528&#xff0c;\u4fee\u6539 a \u5c31\u662f\u5728\u4fee\u6539\u539f\u6765\u7684 x\u3002x 30 y 30\u56e0\u4e3a&#xff1a;int&amp; y x;\u8868\u793a y \u662f x \u7684\u522b\u540d&#xff0c;\u5b83\u4eec\u5bf9\u5e94\u540c\u4e00\u4e2a\u53d8\u91cf\u3002\u672c\u8d28\u533a\u522b&#xff1a;void test(int a)\u662f\u503c\u4f20\u9012&#xff1a;\u628a\u539f\u53d8\u91cf\u7684\u503c\u590d\u5236\u4e00\u4efd\u7ed9 a&#xff0c;\u4fee\u6539 a \u4e0d\u5f71\u54cd\u539f\u53d8\u91cf\u3002\u800c&#xff1a;voi\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/111654.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-01T06:16:50+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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/111654.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/111654.html\",\"name\":\"C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp; - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-01T06:16:50+00:00\",\"dateModified\":\"2026-10-01T06:16:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/111654.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/111654.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/111654.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp;\"}]},{\"@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":"C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp; - \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\/111654.html","og_locale":"zh_CN","og_type":"article","og_title":"C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp; - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e0a\u4e00\u8bfe\u6807\u51c6\u7b54\u6848&#xff1a;\u6700\u7ec8\u8f93\u51fa&#xff1a;20\u56e0\u4e3a&#xff1a;void change(int&amp; a)\u4e2d\u7684 a \u662f x \u7684\u5f15\u7528&#xff0c;\u4fee\u6539 a \u5c31\u662f\u5728\u4fee\u6539\u539f\u6765\u7684 x\u3002x 30 y 30\u56e0\u4e3a&#xff1a;int&amp; y x;\u8868\u793a y \u662f x \u7684\u522b\u540d&#xff0c;\u5b83\u4eec\u5bf9\u5e94\u540c\u4e00\u4e2a\u53d8\u91cf\u3002\u672c\u8d28\u533a\u522b&#xff1a;void test(int a)\u662f\u503c\u4f20\u9012&#xff1a;\u628a\u539f\u53d8\u91cf\u7684\u503c\u590d\u5236\u4e00\u4efd\u7ed9 a&#xff0c;\u4fee\u6539 a \u4e0d\u5f71\u54cd\u539f\u53d8\u91cf\u3002\u800c&#xff1a;voi","og_url":"https:\/\/www.wsisp.com\/helps\/111654.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-01T06:16:50+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/111654.html","url":"https:\/\/www.wsisp.com\/helps\/111654.html","name":"C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp; - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-01T06:16:50+00:00","dateModified":"2026-10-01T06:16:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/111654.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/111654.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/111654.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C++ \u7b2c 15 \u8bfe\uff1a\u6307\u9488 * \u548c\u5730\u5740 &amp;"}]},{"@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\/111654","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=111654"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/111654\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=111654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=111654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=111654"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=111654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}