Initialize 2-D array of unknown size

前端 未结 6 1998
我在风中等你
我在风中等你 2021-01-16 00:42

I have a 2-D array of characters e.g. char aList[numStrings][maxLength]. ideally, during program execution I want to be able to modify the contents of aList i.

6条回答
  •  旧时难觅i
    2021-01-16 01:46

    The situation you've described is precisely what malloc is for -- allocating a variable-length block of memory.

提交回复
热议问题