从最后开始找到'//',把'//'后面的都取出来就行了。
int pos;
char strname[64];
int len = strlen(filename);
for(pos=len-1;pos>=0 && filename[pos]!='//';pos--);
pos++;
strcpy(strname,(char*)filename+pos);
函数名: strstr
功 能: 在串中查找指定字符串的第一次出现
用 法: char *strstr(char *str1, char *str2);
程序例:
#include <stdio.h>
#include <string.h>
int main(void)
{
char *str1 = "Borland International", *str2 = "nation", *ptr;
ptr = strstr(str1, str2);
printf("The substring is: %s/n", ptr);
return 0;
}