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