Copying a subset of an array into another array / array slicing in C

前端 未结 3 746
面向向阳花
面向向阳花 2020-12-16 16:58

In C, is there any built-in array slicing mechanism?

Like in Matlab for example, A(1:4)

would produce =

 1     1     1     1
<
3条回答
  •  清酒与你
    2020-12-16 17:35

    In C,as far as I know, array name is just regarded as a const pointer. So you never know the size of the subset. And also you can assign a arrary to a new address. So you can simply use a pointer instead. But you should manage the size of the subset yourself.

提交回复
热议问题