On Oct 16, 1:20 pm, Erik Wikström <Erik-wikst...@telia.com> wrote:
> On 2007-10-16 09:57, djm wrote:
>
>
>
> > On Oct 16, 12:26 pm, Kai-Uwe Bux <jkherci...@gmx.net> wrote:
> >> djm wrote:
> >> > On Oct 16, 11:43 am, Kai-Uwe Bux <jkherci...@gmx.net> wrote:
> >> >> djm wrote:
> >> [snip]
> >> > just another thing
> >> > as you can see in the header file ive added the line
>
> >> > struct
> >> >> > {
> >> >> > string word;
> >> >> > List defList;
> >> >> > } dictionary[TABLE_SIZE];
>
> >> > how can i make the strings null in the constructor?
> >> > why wont this work?
>
> >> > dictionary.word.clear();
> >> > dictionary.defList=NULL;
>
> >> Because dictionary is an array. You need to iterate through it and setall
> >> pointers to 0. (I think the strings will be constructed empty anyway.)
>
> >> BTW: you should give the struct a name.
> >> BTW: you should also give it a constructor so that it can initialize its
> >> data properly.
>
> >> Best
>
> >> Kai-Uwe Bux
>
> > hmmm then do i actually need a constructor here?
> > cuz
> > 1. the string wil have no initial value?
> > 2. the constructor in List class also makes the contents of "deflist"
> > to NULL
>
> No, you should not need a constructor if that is the case.
>
> --
> Erik Wikström
thanks. it saved a lot of unwanted trouble.