[Solved] Difference between assignment by = sign and strcopy [duplicate]
Actually, if you print the value of x before and after calling: x = “test”; You will see that it has changed. By losing a track to your allocated memory, you face with memory leak here. Furthermore, printf prints a string that starts from the pointer position until it finds the string terminated ‘\0’ (0). … Read more