Sunday, March 13, 2011

Memset sample2

#include "stdio.h"
# include "string.h"
# include "malloc.h"

int main ()
{
char str[] = "Here you can learn memset function";
// memset(pointer,char,no.of byte);
//First 12 bytes replaced by char. here '-'
memset (str,'-',12);
puts (str);
return 0;
}

OUTPUT:

------------ learn memset function
Press any key to continue . . .

No comments:

Post a Comment