On Fri, Dec 12, 2003 at 09:50:23AM +0000, ged.suse@ntlworld.com wrote:
Hi Axel,
My understanding was that by using an array of pointers, you won't need to resize any arrays. The strings pointed to by the pointers will automatically resize to the length of the sting + 1 for the terminating char ('\0').
I have not read about vectors as yet, but they are sure to be next on my list.
That is incorrect. Allocating pointers only provides enough space to hold the memory address of the first character in the string. You would still need to allocate a character array to hold the string itself, and you would have to resize that character array yourself. Your best bet would be to read about vectors and strings. They are both part of the C++ standard library, and they both manage their own memory. Victor