Suppose i have a char variable pointer, and i allocated memory using malloc. is it different between using strcpy and assigned value directly to this pointer?
in term of memory, are both use the same memory that has allocated by malloc ??Code:char *s1; s1 = (char *)malloc(80); s1 = "Test" //assigned value directly to variable pointer S1 strcpy(s1, "hallo") //using strcpy to copy "hallo" to s1
thanks you for you answer