码迷,mamicode.com
首页 > 编程语言 > 详细

C语言截取字符串

时间:2016-08-15 00:05:41      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
 1 void subString(char filePath)
 2 {
 3        int len = strlen(filePath);
 4        int num, n;
 5        char buf[128] = {0};
 6        char cutOff[128] = {0}; 
 7      
 8        strcpy(buf, filePath);
 9        for(num = len - 1; num > 0; num--){
10              if(buf[num] == "\\")
11              {
12                    n = num;
13                    for(num = n+1; num < len; num++){
14                          cutOff[num-n-1] = buf[num];
15                    }    
16                    break; 
17              }  
18       }       
19 }    
View Code

 

C语言截取字符串

标签:

原文地址:http://www.cnblogs.com/jiangson/p/5771336.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!