Copying from One Dynamically Allocated Array to Another C++

前端 未结 3 2062
北海茫月
北海茫月 2021-02-09 07:26

This seems like it should have a super easy solution, but I just can\'t figure it out. I am simply creating a resized array and trying to copy all the original values over, and

3条回答
  •  既然无缘
    2021-02-09 07:53

    orig must be a pointer to a pointer to assign it to resized:

    int **orig;
    *orig = resized;
    

提交回复
热议问题