char * str2num_str(char *str,int type){
    char *type_str;
    if(type==16){
        type_str="%x";
    }else if(type==8){
        type_str="%o";
    } else{
        type_str="%d";
    }
    char *b;
    b = (char *)malloc(sizeof(char)*1024);
    int j=0;
    printf("j=%d\n",j);
    while(*str!=0){
        j+=sprintf(b+j,type_str,*str++);
    }
    return b;
}

 注:只支持转换成10进制,8进制,16进制