Sunday, March 13, 2011

memcpy function sample 1

#include "stdio.h"
# include "string.h"
# include "malloc.h"
int main()
{
char *a= "Karthiken07";
char *b;

b=malloc(10*sizeof(char));

memcpy(b,a,100);

printf("%s\n",b);

return 0;
}

OUTPUT:

Karthiken07
Press any key to continue . . .

1 comment: