What's the use of memset() return value?

后端 未结 4 1205
无人共我
无人共我 2020-12-15 02:16

memset() is declared to return void* that is always the same value as the address passed into the function.

What\'s the use of the return v

4条回答
  •  一整个雨季
    2020-12-15 02:58

    The signature is in line with all the other similar functions: memcpy(), strcpy() etc. I always thought this was done to enable one to chain calls to such functions, and to otherwise use such calls in expressions.

    That said, I've never come across a real-world situation where I would feel compelled to use the return value in such a manner.

提交回复
热议问题