char * mag; char buff[1000]; char number; memcpy((char *)msg,buff,len); strncpy(&number,&msg[0],1); for(int i=0;i < len-1;i++) msg[i]=msg[i+1]; msg[len-1]= newlen= len-1;另一种:
char * mag; char buff[1000]; char number; number = buff[0]; memcpy((char *)msg,buff+1,len); lenbuffret = len-1;第二种效率明显高!