Is there memset() that accepts integers larger than char?

前端 未结 8 598
时光说笑
时光说笑 2020-12-05 00:25

Is there a version of memset() which sets a value that is larger than 1 byte (char)? For example, let\'s say we have a memset32() function, so using it we can do the followi

8条回答
  •  独厮守ぢ
    2020-12-05 00:44

    Check your OS documentation for a local version, then consider just using the loop.

    The compiler probably knows more about optimizing memory access on any particular architecture than you do, so let it do the work.

    Wrap it up as a library and compile it with all the speed improving optimizations the compiler allows.

提交回复
热议问题