Re: struct-functions in C
From: Alwyn (dt015a1979_at_mac.com.invalid)
Date: 09/09/04
- Next message: Auric__: "Re: How do you disable buffering of getc?"
- Previous message: Alwyn: "Re: How do you disable buffering of getc?"
- In reply to: marbac: "struct-functions in C"
- Next in thread: Jack Klein: "Re: struct-functions in C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Auric__: "Re: How do you disable buffering of getc?"
- Previous message: Alwyn: "Re: How do you disable buffering of getc?"
- In reply to: marbac: "struct-functions in C"
- Next in thread: Jack Klein: "Re: struct-functions in C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|