Re: Adding the ability to add functions into structures?



Clark S. Cox III a écrit :
On 2005-12-31 09:50:09 -0500, jacob navia <jacob@xxxxxxxxxxxxxxxx> said:

Eric Sosman a écrit :

jacob navia wrote:

[...]
2) I define the interface functions:
typedef struct {
        // Returns the number of elements stored
        int (*GetCount)(ArrayList &AL);



Whatever this language is, I doubt it's topical on comp.lang.c.

Yes, replace the "&" by  "*".
lcc-win32 supports "&" as in C++, but it can be
replaced by "*". References are just pointers that
can never be NULL. A pointer will do too.


Why do you keep posting code that, while almost C, will only work on a single compiler, on a single platform?


Well, I forgot that. It is a single compiler yes, and I do not have the means of porting it. But what's your point?

Changing "&" by "*" will make it work in any compiler in any platform.

.



Relevant Pages