这个译码怎么显示不出来?

#include
#include <string.h>
#include
#include
#include

using namespace std;
#define maxsize 100
#define maxval 10000.0
int n;
int m = 2*n - 1;

typedef struct HFT
{
float weight;
int parent, LTree, RTree;
string name;

}HFT, *PHFT;

void Select(const PHFT& H, const int& n, int& s1, int& s2){
for(int i = 1; i < n; i++){
if(H[i].parent == 0){
s1 = i;
break;
}
}
for(int i = 1; i < n; i++){
if(H[i].parent == 0 && H[s1].weight > H[i].weight)
s1 = i;
}

for(int j = 1; j < n; j++){
    if(H[j].parent == 0 && j != s1){
        s2 = j;
        break;
    }
}
for(int j = 1; j < n; j++){
    if(H[j].parent == 0 && H[s2].weight > H[j].weight && j != s1)
        s2 = j;
}

}

void initHFC(PHFT& HT, const int& n)
{
if(n <= 1) return;
int m = 2*n - 1;
HT = new HFT[m + 1];
for(int i = 1; i <= m; i++){
HT[i].parent = 0;
HT[i].LTree = 0;
HT[i].RTree = 0;
}
cout << "please input the weight of nodes and nodes' name as 0.23 A: " << endl;
for(int i = 1; i <= n; i++){
cin >> HT[i].weight >> HT[i].name;
}
cout << endl;
for(int i = n+1; i <= m; i++){
int s1, s2;
Select(HT, i, s1, s2);
HT[s1].parent = i;
HT[s2].parent = i;
HT[i].LTree = s1;
HT[i].RTree = s2;
HT[i].weight = HT[s1].weight + HT[s2].weight;
}
}

/** char 类型解决方案 /
void ch_CreateHFMcode(const PHFT& HT, char
* HC, const int& n)
{
char* temp = new char[n];
temp[n-1] = '\0';
int start = 0, c = 0, father = 0;
for(int i = 1; i <= n; i++)
{
start = n - 1;
c = i; //记录正在处理的当前位置
father = HT[i].parent;
while(father != 0) //从叶子节点向上回溯
{ //回溯一次 start指向前一个位置一个
if(HT[father].LTree == c) temp[--start] = '0';
else temp[--start] = '1';
c = father; //当前位置移到父节点
father = HT[father].parent; //更新父节点,继续向上回溯
}
HC[i] = new char[n-start]; // 为第 i 个字符串编码分配空间
strcpy(HC[i], &temp[start]); // 将求得的编码从临时空间cd复制到HC的当前行中,strcpy遇到 \0 拷贝就会结束
}
delete temp;
}

/** string 类型的解决方案 **/
void str_CreateHFMcode(PHFT& H, string *HC, const int& n)
{
string temp;
stack st; //利用栈实现上一个char类型strcpy的方法
int cur = 0, father = 0;
for(int i = 1; i <= n; i++){
cur = i;
father = H[i].parent;
while(father != 0)
{
if(H[father].LTree == cur) st.push("0");
else st.push("1");
cur = father;
father = H[father].parent;
}
while(!st.empty()){
temp += st.top();
st.pop();
}
HC[i] = temp;
temp.erase(); //擦除内存
}
}

void showdata(const PHFT& HFT, char** HC, const int& n){
cout << "index weight parent LTree RTree" << endl;
cout << left;
int m = 2*n - 1;
for(int i = 1; i <= m; i++){
cout << setw(5) << i << " ";
cout << setw(6) << HFT[i].weight << " ";
cout << setw(6) << HFT[i].parent << " ";
cout << setw(6) << HFT[i].LTree << " ";
cout << setw(6) << HFT[i].RTree << " " << endl;
}
cout << endl;

cout << "Name  HFMCode" << endl;
for(int i = 1; i <= n; i++){
    cout << setw(5) << HFT[i].name << "  ";
    cout << setw(7) << HC[i] << "  " << endl;
}

}
void decode(HFT[])
{ PHFT HFT;
HFT[m+1];
int i,j=0;
char b[maxsize];
char rndflag='2';
i=m-1;
cout<<"输入发送的编码(以‘2’为结束的标志);"<<endl;
cin>>b[maxsize];
cout<<"编码后的字符为:"<<endl;

    while(b[j]='2')
{
    if(b[j]=='0')
    {i=HFT[i].LTree ;
    }
    else{
        i=HFT[i].RTree;
    }
    if(i=HFT[i].LTree==0)
    {cout<<HFT[i].name<<endl;
    i=m-1;        }
 j++;}

cout<<endl;
if(HFT[i].LTree!=0&&b[j]!='2')
cout<<"ERROR"<<endl;
}

int main()
{
PHFT HFT;
int n = 0;
cout<<"----哈夫曼编码----"<<endl;
cout << "please intput the number of vertices: ";
cin >> n;
char** HC = new char*[n];
initHFC(HFT, n);
ch_CreateHFMcode(HFT, HC, n);
showdata(HFT, HC, n);
decode(HFT);
return 0;
}

  1. **
    ```

```**

请描述一下程序的功能,及有问题的代码段。