Comment on Tutorial - Using memset(), memcpy(), and memmove() in C By Emiley J
Comment Added by : Anderson Goulart
Comment Added at : 2010-08-24 19:15:14
Comment on Tutorial : Using memset(), memcpy(), and memmove() in C By Emiley J
Sometimes it is useful to return the same address passed in the parameters and the developer should think what parameter he should return.
The common case occur when you want to chain the result of a function inside another function like: strcat(strcpy(buf, "hi "), "friend");
The strcpy function returns the same address of buf, as memcpy does. If strcpy did not return buf address, you should store this value elsewhere before use strcat.
Think of this another situation:
return memcpy(malloc(sizeof(int)), &number, 4)
You use malloc directly inside the memcpy function and has no source pointer stored in a variable. So, in this case, you would need the return value of memcpy.
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
2. Hi All could you pls. send the execution of the ab
View Tutorial By: subbu at 2008-01-28 03:14:27
4. hi i want to run a c program in java program but i
View Tutorial By: jyothi at 2014-11-27 06:40:27
8. When run this code then I am getting a blank page.
View Tutorial By: Paritosh Chandra Dey at 2013-08-14 08:55:42