I'm studying C and I have a question concerning the use of strings in C.
If I have the following code:
string = "Hello";
string = "I have a question";
What's happens with the reserved memory for the string?
- In the first atribution (string = "Hello") we will reserve memory for this string
- In the second atribution what's happens with the memory? Is it the previous memory space for the previous string deleted and a new one is created?
Thanks for any help