In this below code I wan to copy the string in 'pre' to array 'word' so that I can print the array 'word' later but it's showing NONPORTABLE CONVERSION error.. Tried doing it using strcpy() but it dint work. Any other way of doing it??I want to store the strings present in 'pre' into an array each time it's generated..
void print(char *pre,struct dic * root,int depth)
{
int i=0,flag=0,int j=0;
char *word;
for(;i<27;i++)
{
if(root->node[i])
{
pre[depth]='a'+i;
flag=1;
print(pre,root->node[i],depth+1);
pre[depth]=0;
}
}
if(flag == 0)
{
pre[depth]=0;
printf("\n%s\n",pre);
//j is declared globally
***word[j]=pre;***
//printf("\nWord[%d]=%s\n",j,word[j]);
}
}
Thank you..