Currently At: Programming Reference > C Reference > Standard C String & Character > memset()

memset()


Syntax:
#include <string.h>
void *memset( void *buffer, int ch, size_t count );


Description:
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.

Related Topics:
memcmp(), memcpy(), memmove()


Web Standards & Support:

Link to and support eLook.org Powered by LoadedWeb Web Hosting
Valid XHTML 1.0! Valid CSS! eLook.org FireFox Extensions