I want to assign a char*
to char*
, if I use strcpy
I get several run time memory problem so I fix it by simple assignment using = operator
.
Can any one explain what should prepare before using strcpy
to avoid memory issues.
EDIT:
int Function(const char* K,char* FileIN,char* FileOut,int DC)
{
char *fic_in,*n_fic,*fic_out,*fic_dec;
unsigned char k[17];
fic_in = (char*)malloc(60*sizeof(char));
strcpy((char*)k,K);
//strcpy(fic_in,FileIN); //I remove this one
fic_in=FileIN; //and replace it by this
...