我写的树的括号表示法哪错了,怎么改,求大神解答

#include
#include
#include
using namespace std;
struct treenode
{
char data;
treenode *firstchild;
treenode *nextsibling;

};
treenode * creat_tree(char*&a)
{ if((*a)==',')
{
a++;
}
if((*a)=='\0')
return NULL;
if((*a)==')')
{
a++;
return NULL;
}
if((*a)=='(')
{
a++;
}

treenode *t=new treenode();
t->data=*(a++);
t->firstchild=creat_tree(a);
t->nextsibling=creat_tree(a);
return t;

}
void show_tree(treenode *t)
{ //cout<<"123";
if(t==NULL)
return;

cout<<t->data;
for(treenode *p=t->firstchild;p!=NULL;p=p->nextsibling)
{
   show_tree(p);
}

}
int main()
{ //char ch[100];

char *a;//[100];
gets(a);

// puts(a);
treenode *t=creat_tree(a);
show_tree(t);

}