Re: struct-functions in C

From: Alwyn (
Date: 09/09/04

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

In article <%1W%c.256960$>, marbac
<> 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.