What is the advantage of using memset() in C

后端 未结 6 1590
半阙折子戏
半阙折子戏 2020-12-28 09:44

I was curious as to whether or not there was any advantage in regards to efficiency to utilizing memset() in a situation similar to the one below.

Given the followin

6条回答
  •  轮回少年
    2020-12-28 10:10

    memset gives a standard way to write code, letting the particular platform/compiler libraries determine the most efficient mechanism. Based on data sizes it may for example do 32-bit or 64-bit stores as much as possible.

提交回复
热议问题