1

I am modifying some C++ code that has a wchar_t myArray[MAX_PATH] in the header file.

My modifications mean that I cannot know the length of this array until runtime. How can I store an array of dynamic length instead? Maybe I just keep a wchar_t* in the header file and another int to hold its length?

GSerg
  • 76,472
  • 17
  • 159
  • 346
Coder1095
  • 828
  • 10
  • 25

1 Answers1

4

Use std::wstring instead. It's a dynamic string containing wchar_t.

john
  • 7,897
  • 29
  • 27