   strdup-free or delete
  What should we use on pointer returned by strdup. Should I use free or delete. I don't know what(new or malloc) has been used to allocate memory in strdup. Any idea?   
  You should use free since it is from a C library.   ;  well, you should use std::string and forget about all that nonsense   ;  Boder is correct. In the future check the documentation for such functions as it  should say which deallocation method to use.   ;  If it's possible to ask this question in your program (i.e. you're using C++), then you almost certainly shouldn't be using strdup() in the first place.   