C question

Marcus Lundblad ml at update.uu.se
Thu May 6 02:16:32 EDT 2010


tor 2010-05-06 klockan 02:12 -0400 skrev bjlockie at lockie.ca:
> 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.

That would be C++ syntax
C does not have methods in structs like that.
There is just "normal" functions, thus it takes a PurpleBuddy as its
argument (this would correspond to "this" in a hypothetical C++
wrapper).

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






More information about the Devel mailing list