#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main()
{
char filename[16] = "MHT";
char *type = ".txt";
char str[4];
int i = 10;
itoa(i, str, 10);
printf("%s %d\n", filename, sizeof(filename)); //sizeof 全部长度
printf("%s %d\n", filename, strlen(filename)); //strlen 实际字符个数
strcat(filename, str);
printf("%s\n", filename);
printf("%s %d\n", filename, sizeof(filename));
printf("%s %d\n", filename, strlen(filename));
strcat(filename, type);
printf("%s\n", filename);
printf("%s %d\n", filename, sizeof(filename));
printf("%s %d\n", filename, strlen(filename));
return;
}
MHT 16
MHT 3
MHT10
MHT10 16
MHT10 5
MHT10.txt
MHT10.txt 16
MHT10.txt 9