Okay. I have a class that the constructor sets default string values using
strdup to copy the strings into the variables. This is mainly so that the
destructor can call free for each variable without worrying about freeing
unitialized memory. However, what happens when strdup is used a second
time? i.e. the first statement is name = strdup( "Joseph" ) and the second
statement is name = strdup( "Martin" ). What happens to the orginal memory
name pointed to? Is it freed? Is it left there? What do I need to do (if
anything)?
Joseph
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| Joseph Martin: | [EMAIL PROTECTED] |
| Amateur C Programmer, | http://users.exis.net/~jam/ |
| Web Designer, | |
| All around tech nut | |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=