Your version doesn't work because the first parameter Dest needs to be passed by pointer, not by value
#include <iostream>
#include <cstring>
using std::cin;
using std::cout;
void StrCpy(char ** Dest , char* Src )
{
int i;
char *tmp = new char[strlen(Src)+1];
for(i = 0 ; *Src!='\0' ; Src++)
tmp[i]=*Src;
tmp[i]='\0';
*Dest = tmp;
for(int i= 0 ; tmp[i]!='\0' ; i++)
cout << tmp[i];
}
void main()
{
char *string1 = 0;
char * string2 = "EL";
StrCpy( &string1, string2);
// while(*string1)
// cout << *string1++;
}