截取字符串 2008-01-10 08:18 188人阅读 评论(0) 收藏

#include   <string.h>
#include   <stdio.h>


char   *p   =   "//windows//win_dll.txt";
char   ch   =   '//';
char   *plast,   *pfirst;
plast   =   strrchr(   p,   ch   )+1;
pfirst   =   strchr(p,   ch)+1;

//----------------------------------------------------------------

<cstring>   是C++版本
<string.h>   是C版本,   内容基本一致,   看VS2005的 <cstring> 就是#include <string.h>

<string>   是C++定义的std::string   中的内容,   同上面两个无关的.

版权声明:本文为博主原创文章,未经博主允许不得转载。

posted on 2008-01-10 08:18  Joyfulmath  阅读(70)  评论(0编辑  收藏  举报

导航