Programming Tutorials

Comment on Tutorial - Using memset(), memcpy(), and memmove() in C By Emiley J



Comment Added by : Doniv

Comment Added at : 2011-12-15 10:10:52

Comment on Tutorial : Using memset(), memcpy(), and memmove() in C By Emiley J
To 25
void *memset( void *buffer, int ch, size_t count );

The function memset() copies ch into the first count characters of buffer, and returns buffer. memset() is useful for intializing a section of memory to some value. For example, this command:
memset( the_array, '\0', sizeof(the_array) );

is a very efficient way to set all values of the_array to zero.

Basically memset() is used while initialing array of characters or string.


View Tutorial