Re: [OT] Re: C++ *for Git*
- From
- Marco Costalba <mcostalba@gmail.com>
- Date
- Sep 23, 2007, 14:45 UTC
- Message-ID
- <e5bfff550709230745m43ad32dh261edc6fc846602a@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.0.9999.0709231018450.32185@xanadu.home>
On 9/23/07, Nicolas Pitre <nico@cam.org> wrote:
> You must have misunderstood. Why? The linux kernel is itself very > heavily "object oriented" already, even if it is written in C. You > don't need C++ for that. >
Yes it's true, you don't need it. Object oriented in C is achived using function pointers.
In C you fill a struct of function pointers with proper values instead of inherithing from an (abstract) base class as you would do in C++. The results are more or less the same modulo some type safe.
Marco