设为首页 加入收藏

TOP

C语言切割字符串
2014-11-24 02:45:49 来源: 作者: 【 】 浏览:1
Tags:语言 切割 字符串

  /******************************************************************************


  *


  * FUNCTION: Split


  *


  * PURPOSE: Split a delimited line into components


  *


  ******************************************************************************/


  int Split( char * line, char delimiter, char * items[] )


  {


  int cnt = 0;


  for (;;) {


  // Add prefix to list of components


  items[cnt++] = line;


  // Check for more components


  line = strchr( line, delimiter );


  if ( line == NULL )


  return cnt;


  // Terminate previous component and move to next


  *line++ = '\\0';


  }


  }


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C语言函数指针实现跳转 下一篇Java读取资源文件

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: