Does this cause a memory leak because the memory allocated with new is lost when the pointer cstring is assigned to the address of the string literal "I forget".Code:char * cstring; cstring=new char; cstring = "I forget";
Meaning 15*sizeof(char) was lost?
This is a take off of a question posted on a news group I can't respond to so I'm asking here. This is strictly to have a better understanding of legacy code. std::string I know is prefered.