I don't quite understand that. What is the declaration of myList. What's the significance of pair<char*,char*>. Why is the parameter to tokenize_func not const?
actually the braces were added purposely to make the object go out of scope and destroyed....
I have figured the solution afte4r deep thinking.
The parameter to tokenize function is const read from a file but i was testing many new features and perhaps when i copied the code i didnt have that.
Data is elements read at stdin. This is a design of a cscan lexical analyser. well the problem is that i just had to push a class which has a defined dynamic memory into the list and map and the copy constructor would hence create a copy of the object which remains throughout the program life. This is what i wanted and i guess i have achieved by creating two diff class, one for the list and the other for map.
I apologize if i did not explain well as this was a huge program and i had to figure where to cut and paste to explain. However, i appreciate all your input, thank you guys.