Declaring an array of unknown size

后端 未结 4 1262
一向
一向 2021-01-29 09:09

This is not specific to any programming language, the problem is \"find the index of a specified value in an array of n numbers.

Now my question is, in the code below ca

4条回答
  •  伪装坚强ぢ
    2021-01-29 09:28

    In terms of syntax - that would certainly be programming language dependent. But assuming the programming language behaves more or less statically and treats arrays as statically allocated blocks in memory (rather than vectors, etc.), etc. then the first option must be correct as only after n is read a static array can be allocated.

提交回复
热议问题