Sum of two arrays

前端 未结 5 1550
攒了一身酷
攒了一身酷 2021-01-23 14:50

The exercise says \"Make a function with parameters two int arrays and k which is their size. The function should return another array (size k) where every element of it is the

5条回答
  •  执念已碎
    2021-01-23 15:25

    int sum[k] ;
    

    k is a variable but the size of the array should be a constant.

    The function should return another array (size k) ...

    But the function you wrote returns void which is clearly wrong.

    Do I have to do it with pointers?

    Yes.

提交回复
热议问题