Re: Glib::ustring strange error msg ??
- From: Hubert Figuiere <hub figuiere net>
- To: Jamiil <jalqadir gmail com>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Glib::ustring strange error msg ??
- Date: Wed, 07 May 2008 22:18:09 -0400
On Wed, 2008-05-07 at 22:09 -0400, Jamiil wrote:
> const Glib::ustring& jve::Person::getTitle(){
> switch(title){
> case Mr: {return "Mr"; }
> case Mrs: {return "Mrs"; }
> case Miss: {return "Miss";}
> case Ms: { return "Ms"; }
> case Dr: { return "Dr"; }
> default: {return "None";}
> }
> }
>
> Glib::ustring msg = person->getTitle(); <<=== this causes an
> segmentation fault
You are returning a reference to a temporary. Your compiler should have
told you already with a warning.
Hub
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]