Hi,
>
I have a char * mFileList[];
>
how can i dynamically allocate it to save some strings? I'd like to allocate it to and array of POINTERS to char strings, some thing like char *mFileList[1000]
>
Thanks in advance
On Feb 28, 3:12 pm, "Victor Bazarov" <v.Abaza...@com Acast.netwrote:
huohaod...@gmai l.com wrote:
I have a char * mFileList[];
>
how can i dynamically allocate it to save some strings?
>
std::vector<std ::stringmFileLi st;
>
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
I tried char * mFileList[] = new char[index]; but got a syntax error.
On Feb 28, 3:46 pm, "Victor Bazarov" <v.Abaza...@com Acast.netwrote:
huohaod...@gmai l.com wrote:
[..]
I tried char * mFileList[] = new char[index]; but got a syntax error.
>
char **mFileList = new char*[size];
>
But let me reiterate, do NOT presume managing dynamic memory is
easy or recommended. Try to stick to standard containers before
you learn enough. Do
>
std::vector<std ::stringmFileLi st(size);
>
It's basically all you need, trust me.
>
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Comment