How do i pass an array function without using pointers

前端 未结 7 885
广开言路
广开言路 2021-02-05 21:04

I have been asked in an interview how do you pass an array to a function without using any pointers but it seems to be impossible or there is way to do this?

7条回答
  •  旧时难觅i
    2021-02-05 21:48

    If i say directly then it is not possible...!

    but you can do this is by some other indirect way

    1> pack all array in one structure & pass structure by pass by value

    2> pass each element of array by variable argument in function

提交回复
热议问题