Re: OOP in C!
From: Prashanth Ellina (prashanthellina_at_hotpop.com)
Date: 06/07/04
- Next message: Ben Pfaff: "Re: Fundamental question"
- Previous message: Keith Thompson: "Re: Fundamental question"
- In reply to: Mike Wahler: "Re: OOP in C!"
- Next in thread: E. Robert Tisdale: "Re: OOP in C!"
- Reply: E. Robert Tisdale: "Re: OOP in C!"
- Reply: Mike Wahler: "Re: OOP in C!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Jun 2004 14:24:36 -0700
"Mike Wahler" <mkwahler@mkwahler.net> wrote in message news:<VNOvc.20736$Tn6.8282@newsread1.news.pas.earthlink.net>...
> #include <stdio.h>
>
> struct S
> {
> int member;
> void (*fp)(struct S *);
> };
>
> void func(struct S *param)
> {
> printf("%d\n", param->member);
> }
>
> int main()
> {
> struct S object = {42, func};
> func(&object); /* prints 42 */
shouldn't the above line be,
object.fp(&object);
?
> return 0;
> }
>
> -Mike
>
>
>
> >
> > Thanks in advance,
> > Prashanth Ellina
- Next message: Ben Pfaff: "Re: Fundamental question"
- Previous message: Keith Thompson: "Re: Fundamental question"
- In reply to: Mike Wahler: "Re: OOP in C!"
- Next in thread: E. Robert Tisdale: "Re: OOP in C!"
- Reply: E. Robert Tisdale: "Re: OOP in C!"
- Reply: Mike Wahler: "Re: OOP in C!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|