Re: Glib::ustring



On Sat, 2007-08-25 at 16:04 -0700, Jamiil Abduqadir wrote:
> OS : MSWinXP
> gcc: 3.4.2
> gtk:  gtkmm-win32-devel-2.10.8-1
> problem:  Glib::ustring
> 
> 
> Assignment methods in Glib::ustring are giving me serious problems. Simple 
> statements as:
> 
> class MC{
>    Glib::ustring* str;
> public:
>    void method();
> };
> MC::method(){
>    str =  new Glib::ustring("Nada");
>    this->str = ""; //segmentation error
> }
> Or if I use  this->str->assign("") create a segmentation error,
> gdb reports the error as follows:
> Program received a signal SIGSEGV, segmentation fault.
> in std::string::assign(std::string const&)()
> 
> Why am I getting this error and how can I resolve it?

	Glib::ustring str;
	str = "Nada";
	str = "";

Declaring pointer-to-ustring is rather odd and almost certainly not what
you want.

--p





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]