// memcpstr.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "string.h" int main(int argc, char* argv[]) { char str1[100]="BCD"; char str2[100]="AAAAAAAA"; int i=0; for(i=1;i<=4;i++) { memcpy(str2,str1,i); printf("%s\n",str2); } return 0; } /* BAAAAAAA BCAAAAAA BCDAAAAA BCD Press any key to continue */