Hello
given the following code:
i should implement the str_cpy function.Code:
void func(){
char *var=NULL;
str_cpy(var,"text1");
str_cpy(var,var+2);
some print(var) // result: xt1
some_free(var)
}
how would you implement it efficiently (without memory leaks)?