<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ```c #include <stdio.h> int main() { int a; int b[10] ; printf(" b:%d\n b+1:%d\n &b:%d\n &b+1:%d \n", b, b+1, &b, &b+1); printf("sizeof(b):%d \n", sizeof(b)); printf("sizeof(a):%d \n ", sizeof(a)); } ``` 運行結果如下: ![](https://img.kancloud.cn/af/fb/affbc6909983fda785b62430ce0f0ab5_569x159.png) b:6422000:**數組首元素的地址** b+1:6422004:**數組元素+1的地址,一個元素4個字節,所以是6422004** 我們來驗證一下這個結論: ```c int b[10] ={1,2,3,4,5,6,7,8,9,10}; printf(" b+1:%d\n",*(b+1)); printf(" b+1:%d\n",*(b+2)); printf(" b+1:%d\n",*(b+3)); ``` ![](https://img.kancloud.cn/f0/84/f084e6eb1b3f50b6adc14b29e03a32b1_454x130.png) 和我們分析的是一致的。 &b:6422000:**整個數組的地址** &b+1:6422040:**數組地址+數組預分配內存空間** sizeof(b):40:**c編譯器分配40個字節的內存** sizeof(a):4:**c編譯器分配4個字節的內存** **數據類型的本質:固定大小內存塊的別名** ```c int main() { int a = 10; int b[10] ; printf("int a:%d \n", sizeof(a)); printf("int a:%d \n", sizeof(int *)); printf("int b:%d \n", sizeof(b)); printf("int b:%d \n", sizeof(b[0])); printf("int b:%d \n", sizeof(*b)); printf("hello.....\n"); getchar(); return 0; } ``` ![](https://img.kancloud.cn/f1/53/f1533bb97f21c5cddc89bbe5c9ff4bef_899x142.png) 為什么int是4 而int *是8? **指針幾個字節跟語言無關,而是跟系統的尋址能力有關,譬如以前是16為地址,指針即為2個字節,現在一般是32位系統,所以是4個字節,以后64位,則就為8個字節。**
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看