C question

Eoin Coffey ecoffey at gmail.com
Thu May 6 02:16:55 EDT 2010


On Thu, May 6, 2010 at 12:12 AM,  <bjlockie at lockie.ca> wrote:
> I saw C code that does:
>            PurpleBuddy *b = buddies->data;
>            PurplePresence *p = purple_buddy_get_presence(b);
>
> It made me wonder you can't do:
>            PurpleBuddy *b = buddies->data;
>            PurplePresence *p = b->purple_buddy_get_presence();
> It seems logical to me.
>

Yes it would seem logical if C was a Object Oriented language, but it
is not.  There is no syntax for calling a function bound to an object
(method or member function in Java / C++).

But Pidgin / libpurple does use a object oriented api, and it is more
than doable to have some OO flavor in C libraries (gtk+ for instance).

Hope that helps!

-Eoin

> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/devel
>




More information about the Devel mailing list