memcpy(), what should the value of the size parameter be?

前端 未结 12 2197
灰色年华
灰色年华 2020-12-09 09:36

I want to copy an int array to another int array. They use the same define for length so they\'ll always be of the same length.

What are the pros/cons of the followi

12条回答
  •  余生分开走
    2020-12-09 10:04

    Will the second option always work? Regardless of the content?

    It will work only if both conditions are satisfied:

    • dst is regular array, not pointer
    • src and dst are the same size

提交回复
热议问题