Converting a std::list to char*[size]

前端 未结 6 1246
温柔的废话
温柔的废话 2021-01-21 20:54

for some reason I cannot explain, every single item in the character array...is equal to the last item added to it...for example progArgs[0] through progArgs[size] contains the

6条回答
  •  清歌不尽
    2021-01-21 21:33

    The char array item is local variable and is available only within the for loop.

    Instead allocate it dynamically.

提交回复
热议问题