#include
#include
#define STRING_LONGTH 20
unsigned char String_buf[]={"String分割你好啊哈好哈哈好爱好啊哈啊哈哈爱好啊"};
unsigned char Temp_buf[100] ={0};
int main()
{
int i =0;
int j =0;
int z =0;
if(strlen(String_buf)>STRING_LONGTH)
{
for(; i {
if(String_buf[i] >0x80)
{
Temp_buf[i] = String_buf[z];
Temp_buf[i+1] = String_buf[z+1];
i+=1;
z+=2;
}
else
{
Temp_buf[i] = String_buf[i];
z++;
}
}
Temp_buf[i++] ='.';
Temp_buf[i++] ='.';
Temp_buf[i++] ='.';
Temp_buf[i] ='\0';
}
printf("Temp_buf = %s\n",Temp_buf);
}
阅读(1135) | 评论(0) | 转发(0) |