hu********@gmail.com wrote:
Hi,
I have a char * mFileList[];
how can i dynamically allocate it to save some strings?
Thanks in advance
If possible, try std::vector<std::stringmFileList;
If not possible, try std::vector<char*mFileList;
The std::vector should be as effective as anything manaul, such as new
char*[count] and with a known value you can do:
std::vector<char*mFileList( count );
Which will create a dynamic array of count elements of char*.
Still, std::vector<std::stringis much prefered, but it really depeneds on
your code.
--
Jim Langston
ta*******@rocketmail.com