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

            strtok用法--提取字符串

                最近看Petzold的《windows程序設(shè)計》,在Internet那章中看到如何在字符串中提取IP地址,特地標(biāo)記一下:
            1 GetDlgItemTextA (hwnd, wServer, szLabel, sizeof (szLabel));
            2 strtok (szLabel, "(");
            3 strcpy (szServer, strtok (NULL, ")"));
                在Msdn上查了一下,有下面一段:

                On the first call to strtok , the function skips leading delimiters and returns a pointer to the first token in strToken , terminating the token with a null character. More tokens can be broken out of the remainder of strToken by a series of calls to strtok . Each call to strtok modifies strToken by inserting a null character after the token returned by that call. To read the next token from strToken , call strtok with a NULL value for the strToken argument. The NULL strToken argument causes strtok to search for the next token in the modified strToken . The strDelimit argument can take any value from one call to the next so that the set of delimiters may vary.

            Warning    Each of these functions uses a static variable for parsing the string into tokens. If multiple or simultaneous calls are made to the same function, a high potential for data corruption and inaccurate results exists. Therefore, do not attempt to call the same function simultaneously for different strings and be aware of calling one of these function from within a loop where another routine may be called that uses the same function.  However, calling this function simultaneously from multiple threads does not have undesirable effects.

                看來用了靜態(tài)變量,還好有多線程的C運行庫,否則在多線程在有麻煩了。

            posted on 2009-10-19 23:05 gewala 閱讀(2335) 評論(0)  編輯 收藏 引用 所屬分類: C++

            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            導(dǎo)航

            統(tǒng)計

            常用鏈接

            留言簿

            隨筆分類

            隨筆檔案

            文章分類

            文章檔案

            設(shè)計模式 網(wǎng)絡(luò)編程

            網(wǎng)絡(luò)

            搜索

            最新評論

            閱讀排行榜

            評論排行榜

            蜜臀av性久久久久蜜臀aⅴ麻豆| 狠狠久久亚洲欧美专区| 99久久99久久精品国产片| 国产999精品久久久久久| 伊人久久一区二区三区无码| 亚洲精品白浆高清久久久久久| 99久久精品费精品国产一区二区 | 久久精品国产AV一区二区三区| 狠狠综合久久AV一区二区三区| 韩国三级大全久久网站| 亚洲AⅤ优女AV综合久久久| 色综合久久无码中文字幕| 国产亚洲美女精品久久久 | 亚洲精品蜜桃久久久久久| 国产精品久久成人影院| 中文成人久久久久影院免费观看| 久久久久久亚洲AV无码专区| 久久这里都是精品| 国产L精品国产亚洲区久久| 久久综合狠狠综合久久综合88 | 久久频这里精品99香蕉久| 久久美女人爽女人爽| 久久久久人妻一区精品色| 无码人妻久久一区二区三区蜜桃| 国产精品久久久久9999| 久久综合给合久久国产免费 | 久久这里只有精品首页| 久久e热在这里只有国产中文精品99 | 精品久久久久久无码人妻热| 久久精品无码午夜福利理论片 | 久久亚洲AV成人无码国产| 久久婷婷色香五月综合激情| 久久午夜综合久久| 国产福利电影一区二区三区久久久久成人精品综合 | 中文精品久久久久国产网址| 久久久一本精品99久久精品88| 亚洲AV伊人久久青青草原| 久久人人爽人人爽人人片AV麻豆| 久久成人精品| 亚洲欧美日韩精品久久亚洲区 | 亚洲精品tv久久久久久久久|