Re: [Dev-C++] Glib::ustring::assign(...)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: matheus r. <mfr...@gm...> - 2007-08-18 15:49:55
|
> jme::Combo::Combo(const Glib::ustring& title){
> Glib::ustring* ustr;
> std::auto_ptr<Glib::ustring> ustr(new Glib::ustring("Unknown"));
> if(!title.empty()) {
> this->ustr->assign(title);
> }
> }
> Thanks in advance!
My guess is that ustr is both a local variable and a member variable
with the same name. In the example above, you assigned the new glib
string to the local variable but used assign on the member below,
which was probably not initialized.
If both are auto_ptr, I guess what you wanted to do is:
ustr.reset(new Glib::ustring("Unknown"));
instead of
std::auto_ptr<Glib::ustring> ustr(new Glib::ustring("Unknown"));
|