Code:
Here is my problem: In the following code pcodewords is pointer of pointers of structure type. NodeConstruct, GetCodeWord and nextcw are functions with their own proper implementation. I am confused that eventhough the pointer pcodewords[0] is not affected by the do while loop, the printing results for its corrosponding structure variable before and after the do while loop are not the same.
I am really stacked because of this . I really need your help guys and it is urgent! 10q anyway!
pcodewords[0]=NodeConstruct(cw,n);
//printing values for checking
int *p=GetCodeWord(pcodewords[0]);
for(int j=0;j<n;j++)
printf("%d", *(p+j));
printf("\n");
int *cexist,i=1;
do
{
cexist=nextcw(cw,n);
if(cexist)
pcodewords[i]=NodeConstruct(cexist,n);
++i;
}while(cexist);
pcodewords[0]=NodeConstruct(cw0,n);
//printing the values for checking
int *p=GetCodeWord(pcodewords[0]);
for(int j=0;j<n;j++)
printf("%d", *(p+j));
printf("\n");
}