*szString = things question/memory question
Hi,
I wasn't sure what to google for this one, but I did try (at least a little).
I'm wondering what happens, with respect to memory, when you do this
Code:
void myFunction(char* szInput)
{
char* szTemp = "Hello";
szInput = szTemp;
return;
}
The local copy of szInput is replaced by szTemp. No malloc was done, so no free'ing needs to be done on szTemp.
What about szInput? Will the implementation "know" to free the original location of the copy of szInput, or is that a memory leak?
thanks