截取若干个字符后面的字符串
#include <stdio.h>
#include <string.h>
char *strOp(char *oldstr, char newstr[])
{
    int nsplash, i;
    int res = 0;
    nsplash=0;
    for(i = 0; nsplash < 4 && oldstr[i]!= '\0';i++)
    {
        if(oldstr[i] == '/')
          nsplash++;
    }
    for(;oldstr[i] != '\0';i++)
    {
        newstr[res++] = oldstr[i];
    }
    return newstr;
}
int main()
{
 char s[] = "/sdb/data/1/20201212992.mp4";
 char b[255] = {0};
char c[255] = "/mnt/usb33/download/";
  strOp(s,b);
  strcat(c,b);
  printf("%s\n",b);
  printf("%s\n",c);
  return 0;
}
输出:20201212992.MP4
 
                    
                     
                    
                 
                    
                 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号