Re: struct-functions in C

From: Alwyn (dt015a1979_at_mac.com.invalid)
Date: 09/09/04


Date: Thu, 09 Sep 2004 12:04:17 +0100

In article <%1W%c.256960$vG5.154641@news.chello.at>, marbac
<marbac@chello.at> wrote:
>
> is a function within a struct allowed in C or is this only allowed in C++?

No, 'struct's are for data; putting a function within a 'struct' would
have no meaning in C. But pointers to functions are OK, and you could
even simulate some sort of object-oriented capability that way, though
it's not something I would advise to a beginner.

Alwyn