#include <string.h>
#include <stdio.h>
int main()
{
char filename[100] = "text.txt";
char *ext = strrchr(filename, '.');
if (ext)
{
*ext = '\0';
ext++;
}
printf("name=%s\n", filename);
printf("ext-name=%s\n", ext);
return 0;
}

相关文章:

  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2021-08-03
  • 2021-12-19
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
相关资源
相似解决方案