<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ### 靜態數組 C語言只支持靜態數組.當數組大小固定后,不能再添加或刪除元素.而且又不能通過創建新數組的方式來增加元素數量,因為,當前數組的指針可能在其他地方正在被使用.如果創建新的數組,雖然完成了需求,但是原數組被使用的地方還是無法改變. ### 定義方式一 ~~~ int nums[10]; //類型 數組名[個數] nums[0] = 100; for (int i = 0; i < 10; ++i) { printf("%d\n", nums[i]); } ~~~ ``` 100 0 0 0 0 0 0 0 ``` ### 定義方式二 ~~~ int nums2[] = {1, 2, 3, 4}; //字面量方式,且不寫元素個數 for (int i = 0; i < 4; ++i) { printf("%d\n", nums2[i]); } ~~~ ``` 1 2 3 4 ``` ### 循環賦值 ~~~ int nums[5]; for (int i = 0; i < 5; ++i) { scanf("%d", &nums[i]); //需要用 & } for (int j = 0; j < 5; ++j) { printf("%d\n", nums[j]); } ~~~ ### 獲取數組元素個數 ~~~ int nums[5]; for (int j = 0; j < 5; ++j) { nums[j] = 90 + j; } int sum = sizeof(nums); //獲取總數組字節數大小 printf("%d\n", sum); int length = sum / sizeof(int); //除以每個元素所占字節大小,sizeof()可以計算類型長度. printf("%d\n", length); ~~~
                  <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>

                              哎呀哎呀视频在线观看