字符串分割和连接出现一个诡异的问题无法解决
char* IP = "192.168.1.24";char* IP1=strstr(IP,".")+1;
char *p1 = strtok(IP, ".");
char* IP2=strstr(IP1,".")+1;
char *p2 = strtok(IP1, ".");
char *p3 = strtok(IP2, ".");
char* ipend=p1;
ipend=strcat(ipend,".");
ipend=strcat(ipend,p2);
ipend=strcat(ipend,".");
ipend=strcat(ipend,p3);
ipend=strcat(ipend,".");
ipend=strcat(ipend,"255");
运行到最后ipend的值为192..1.255,p2的值莫名其妙就变成空了,请高手指教下。