494
C++ trim function
Submitted by dv on Tue, 2008-04-15 17:25.
Trim function for C++ std::string:
using namespace std; #include <string> inline string trim(const string& o) { string ret = o; const char* chars = "\n\t\v\f\r "; ret.erase(ret.find_last_not_of(chars)+1); ret.erase(0, ret.find_first_not_of(chars)); return ret; }
It returns a new string, sort of like it’s done in Qt or Java.
Qt GDB errors
Submitted by dv on Sun, 2008-03-23 03:21.
I’ve been having strange problems with Qt4 applications and GDB. I can’t debug any Qt4 app in either Eclipse or KDevelop. See this thread on the qt-interest list. The error I get:
Cannot insert breakpoint 0. Error accessing memory address 0x0: Input/output error.
Running GDB from the command line on the binary works fine. I just found that NetBeans 6.0 with the C++ plugin works fine as well. I wonder what’s wrong with Eclipse and KDevelop. Could be the way they try to interface with GDB.










Recent comments
17 weeks 2 days ago
17 weeks 2 days ago
28 weeks 5 days ago
28 weeks 6 days ago
34 weeks 1 day ago