memset()的用法是什么? [英] What's the use of memset() return value?

查看:210
本文介绍了memset()的用法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

memset()被声明为返回 void * ,它总是与传递到函数。

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

返回值的用途是什么?为什么它不返回 void

What's the use of the return value? Why does it not return void?

推荐答案

与所有其他类似的功能: memcpy() strcpy()等我一直认为这是为了启用一个链接调用这样的函数,否则在表达式中使用这样的调用。

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.

这篇关于memset()的用法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆