Re: ustring = "1.2"



On Wed, 2007-12-19 at 15:16 -0500, Jamiil Abduqadir wrote:
> Gtkmm for Win32
> windows xp
> 
> Hello folks!
> 
> In the following  example 
> class MyClass{
> Glib::ustring str;
> MyClass();
> ~MyClass();
> };
> MyClass::MyClass(){ str = "1.2";}

Better style:
MyClass::MyClass()
	: str("1.2")
{
}

Using initializer list is always better.

Hub



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