Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • problem is not the allocation - even i dont know the max size of the string if i creating it - i have another version where i'm using 'my string' class which is char* with malloc and free which is working perfect - but i need to use std::string functions like find_first_not_of... (which will takes looong time to implement to my string class) - what i need is to clean after string somehow Commented Apr 15, 2011 at 22:32
  • @tominko: Do not forget that if you have a string in a char buffer the old C string functions still work. You could #include <cstring> and use strcspn to replace find_first_not_of. Commented Apr 15, 2011 at 22:38
  • @Zan Lynx: i think i have to get rid of std::string ;-( Commented Apr 15, 2011 at 22:42
  • @tominko no you don't, you have to fix your code to not do as much at once. Commented Jan 21, 2015 at 1:34