wrote:
> can some one tell that how to use pure c to write OO programs?
>
1. Face a wall.
2. Take quite a few steps back.
3. Holding your head down, run towards the wall.
4. Repeat until you feel you have inflicted enough harm on yourself.
I realize this is not really helpful. Neither is pure C when it comes to
O-O programming, however.
In my opinion, you'd be much better off using a C++ frontend,
restricting yourself to basic O-O concepts while ignoring the C++ bells
and whistles that are not essential to your design. I don't know about
any frontends still out there, though ("if I want C++, I know where to
get it"). Anyone know if cfront or a clone still lives, and is of any use?
You could even go crazy and use, you know, an actual C++ compiler. Many
produce quite acceptable code (in terms of size/speed/overhead) for
simple C++ that doesn't pull in all the STL goodies. In fact, the
initial design criteria for C++, for better or worse, included the
notion that compilers shouldn't be too burdened processing it
effectively (not much was left of this notion by the time the language
was finalized, but that's another issue).
Of course this won't help you if you don't have a C++ compiler for the
platform or if object file compatibility with C code is necessary, but
it's still worth considering.
S.