char Text[128] = "aaaaaaa";
char Cryptograph[128] = "0"; //加密后的字符串
int userId[2] = {123456789};
char string[20] = "abcdc";
char data[20] = "2014/9/20";
char platform[20] = "web";
count=strlen(Text);
printf("strlen(Text) :%d \n",count); //7
strcpy(Text,(char *)&userId);
strcpy(Text+sizeof(userId),string);
strcpy(Text+sizeof(userId)+sizeof(string), data);
strcpy(Text + sizeof(userId)+sizeof(string)+sizeof(data), platform);
int count2=strlen(Text);
printf("strlen(Text) :%d \n",count2); //始终是4
字符串操作经常遇到的马虎问题
最新推荐文章于 2024-08-15 10:49:31 发布