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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                **引言:** **單片機的編程中經常用到while(1)死循環來進行輪尋操作,但分析Linux內核源代碼時卻經常見到for(;;)作為死循環的條件。** **兩者區別:** **區別一** **for(;;)死循環里的兩個;;代表兩個空語句,編譯器一般會優化掉它們,直接進入循環體。** **while(1)死循環里的1被看成表達式,每循環一次都要判斷常量1是不是等于零。** **區別二** **同樣的代碼,編譯出的程序代碼大小不同。** **示例分析:** **for.c源碼:** ~~~ #include <stdio.h> int main(void) { for(;;){ printf("123\n"); } return 0; } ~~~ **while.c源碼:** ~~~ #include <stdio.h> int main(void) { while(1){ printf("123\n"); } return 0; } ~~~ **匯編上面的兩個程序發現它們的匯編源碼完全相同:** ~~~ .file "while.c" .section .rodata .LC0: .string "123" .text .globl main .type main, @function main: pushl %ebp movl %esp, %ebp andl $-16, %esp subl $16, %esp .L2: movl $.LC0, (%esp) call puts jmp .L2 .size main, .-main .ident "GCC: (Ubuntu 4.4.1-4ubuntu8) 4.4.1" .section .note.GNU-stack,"",@progbits ~~~ **這樣看來兩者似乎沒有任何區別,其實不然,編譯生成程序的大小不同:** **-rwxr-xr-x 1 book book 8296 2014-06-12 22:32 for -rwxr-xr-x 1 book book 8298 2014-06-12 22:33 while**
                  <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>

                              哎呀哎呀视频在线观看