Initializing an array after declaration

前端 未结 4 1383
自闭症患者
自闭症患者 2021-01-27 01:56

gcc 4.4.3 c89

I have the following code as a sample of what I am trying to do. I don\'t know the actual size of the array, until I enter the function. However, I don\'t

4条回答
  •  隐瞒了意图╮
    2021-01-27 02:40

    You should use a pointer, so when you enter the method the array is still not declared. You can use malloc to set the correct size. Look at this article: arrays and malloc

提交回复
热议问题