Re: GdkColor weird type? Why not pointer like GtkWidget*....



Am Mon, 2002-04-22 um 19.53 schrieb rsteinke w-link net:
> 
> It really an extern "C" struct with four members.
> Since it's extern "C", you need to initialize it
> in the proper C (_not_ C++) way. For a struct in C,
> you provide an initialization list for the members,
> e.g.
> 
> GdkColor color = {0, 0, 0, 0};
> 
> If you provide fewer initializers than there are members,
> the last initializer is used to initialize all remaining
> members, so
> 
> GdkColor color = {0};
> 
> is equivalent.
> 
> Just because you're initializing GdkColor in C++ doesn't
> mean you can treat it like a C++ class. It's still a
> C struct.

This has absolutely _nothing_ to do with C++ or extern "C".  C++
supports constructors as alternative way to do the initialization, but
it's not a requirement.

--Daniel




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