Discussion: please help
Afficher un message
Vieux 16/10/2007, 08h26   #4
Kai-Uwe Bux
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: please

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 set all
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

  Réponse avec citation
 
Page generated in 0,05250 seconds with 9 queries