Bharani Aug 31st, 2007 Memset is used to set a buffer with a specific character for example memset (dptr, 'A', 10); // sets the first 10 character to character 'A'#include <memory.h>#include <stdio.h>int main( void ){ char buffer[] = "This is a test of the memset function"; printf( "Before: %sn", buffer ); memset( buffer, '*', 4 ); printf( "After: %sn", buffer );}OutputBefore: This is a test of the memset functionAfter: **** is a test of the memset function
vignesh1988i Profile Answers by vignesh1988i Oct 4th, 2009 How will this memset() function willl handle the worst case (ie) when the string is lesser than the given length If my string is char string[]="i love my india";If I use the function memset(string, '*' , 20);Will it handle these type of complexities?
Vinay Jan 22nd, 2013 This code gives warnings which is not the good sign while dealing with the network programming.
What is memset, and why it is used, When it is used?
Related Answered Questions
Related Open Questions