<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國際加速解決方案。 廣告
                但查看提交詳細資料后,Byron 實現字符串的長度不能為負數,所以他決定改變my_strlen函數的返回類型。 Byron 使用git日志命令來查看日志信息。 [byron@CentOS project]$ git log 上面的命令會產生以下結果。 commit cbe1249b140dad24b2c35b15cc7e26a6f02d2277 Author: Byron <xiaobosun@gridinfo.com.cn> Date: Wed Sep 11 08:05:26 2015 +0530 Implemented my_strlen function Byron 使用git show命令查看提交的細節。 Git的show命令的SHA-1提交ID作為參數。 [byron@CentOS project]$ git show cbe1249b140dad24b2c35b15cc7e26a6f02d2277 上面的命令會產生以下結果。 commit cbe1249b140dad24b2c35b15cc7e26a6f02d2277 Author: Byron <xiaobosun@gridinfo.com.cn> Date: Wed Sep 11 08:05:26 2015 +0530 Implemented my_strlen function diff --git a/string.c b/string.c new file mode 100644 index 0000000..187afb9 --- /dev/null +++ b/string.c @@ -0,0 +1,24 @@ +#include <stdio.h> + +int my_strlen(char *s) +{ + char *p = s; + + while (*p) + ++p; + return (p -s ); +} + 他改變了函數的返回類型 從int 修改為 size_t。測試代碼后,他查看其變化運行git diff命令。 [byron@CentOS project]$ git diff 上面的命令會產生以下結果。 diff --git a/string.c b/string.c index 187afb9..7da2992 100644 --- a/string.c +++ b/string.c @@ -1,6 +1,6 @@ #include <stdio.h> -int my_strlen(char *s) +size_t my_strlen(char *s) { char *p = s; @@ -18,7 +18,7 @@ int main(void) }; for (i = 0; i < 2; ++i) - printf("string lenght of %s = %d ", s[i], my_strlen(s[i])); + printf("string lenght of %s = %lu ", s[i], my_strlen(s[i])); return 0; } Git 的差異顯示+號前行,這是新增加的,并顯示符號被刪除。
                  <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>

                              哎呀哎呀视频在线观看