Sum of two arrays

前端 未结 5 1540
攒了一身酷
攒了一身酷 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:06

    One issue is that you've attempted to declare dynamically sized arrays on the stack (e.g. a[g]). You need to declare pointers for each array and then dynamically allocate your variable sized array once you've read in the value of g.

提交回复
热议问题