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 value? Why does it not return void?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.