• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Jiwu Bu

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              32 隨筆 :: 0 文章 :: 25 評論 :: 0 Trackbacks
            轉載鏈接:http://blog.chinaunix.net/u2/76292/showart_1845022.html

             1 #include <stdlib.h>
             2 #include <stdio.h>
             3 #include <ctype.h>
             4 
             5 long my_atol(const char *nptr)
             6 {
             7     int c; /* current char */
             8     long total; /* current total */
             9     int sign; /* if '-', then negative, otherwise positive */
            10 
            11     /* skip whitespace */
            12     while ( isspace((int)(unsigned char)*nptr) )
            13     {
            14         ++nptr;
            15     }
            16     
            17     c = (int)(unsigned char)*nptr++;
            18     sign = c; /* save sign indication */
            19     if (c == '-' || c == '+')
            20     {
            21         c = (int)(unsigned char)*nptr++/* skip sign */
            22     }
            23     
            24     total = 0;
            25 
            26     while (isdigit(c)) 
            27     {
            28         total = 10 * total + (c - '0'); /* accumulate digit */
            29         c = (int)(unsigned char)*nptr++/* get next char */
            30     }
            31 
            32     if (sign == '-')
            33     {
            34        return -total;
            35     }
            36     else
            37     {
            38         return total; /* return result, negated if necessary */
            39     }
            40 }
            41 
            42 int  main(int argc, char* argv[])
            43 {
            44     if( argc < 2 )
            45     {
            46         return -1;
            47     }
            48 
            49     int i = my_atol(argv[1]);
            50     printf("[%s]====>[%d]\n", argv[1], i);
            51    
            52     int j = atoi(argv[1]);
            53     printf("[%s]====>[%d]\n", argv[1], j);
            54 
            55     return 0;
            56 }
            57 
            http://www.shnenglu.com/Files/bujiwu/atoi.rar

            posted on 2010-01-15 17:52 bujiwu 閱讀(1430) 評論(0)  編輯 收藏 引用 所屬分類: 算法與數據結構
            国内精品久久久久影院老司 | 久久久久久噜噜精品免费直播| 久久精品国产第一区二区三区| 国产麻豆精品久久一二三| 国内精品久久久久影院网站| 性做久久久久久免费观看| 成人免费网站久久久| 蜜桃麻豆www久久国产精品| 亚洲精品午夜国产VA久久成人| 久久久91精品国产一区二区三区| 久久久久亚洲AV无码专区桃色| 欧美丰满熟妇BBB久久久| 国产精品成人无码久久久久久| 综合人妻久久一区二区精品| 国产99久久久国产精免费| 无码AV波多野结衣久久| 香蕉久久影院| 久久狠狠一本精品综合网| 精品久久久无码人妻中文字幕豆芽 | 91精品国产高清久久久久久io| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 日本加勒比久久精品| 久久精品国产福利国产秒| 麻豆亚洲AV永久无码精品久久| 一级女性全黄久久生活片免费| 久久er国产精品免费观看8| 精品国产一区二区三区久久久狼| 日本WV一本一道久久香蕉| 欧美亚洲日本久久精品| 久久黄视频| 久久91精品综合国产首页| 97久久精品人人做人人爽| 国产欧美一区二区久久| 好属妞这里只有精品久久| 99久久婷婷国产综合亚洲| 久久精品国产亚洲AV无码娇色| 午夜精品久久久久久毛片| 午夜精品久久久久久99热| 精品永久久福利一区二区 | 中文字幕无码精品亚洲资源网久久| 欧美无乱码久久久免费午夜一区二区三区中文字幕 |