In article <11*********************@l41g2000cwc.googlegroups. com>,
ka**********@gmail.com <ka**********@gmail.com> wrote:
C++ was created because C and other procedure-oriented languages
could not address the complex problems that are present in real life.
So the question of translating C++ code to C is absurd. You have to
rewrite the code completely and that would be no small feat.
Sorry, Karthik, but your history is not accurate.
C++ *is* a "procedure-oriented language", just with a more
flexible mechanism than for C to decide -which- procedure to use.
If you want a non-procedural language, you will have to look at
programming languages such as PROLOG that specify goals and
leave it up to the language implimenter on how to systematically
approach the goals. Do not confuse "object-oriented" with
non-procedural !!
C++ was not invented because C *could not* be used for certain
problems: C++ was invented because reformulating parts of C made
for a language that some problems easier to express, and made it
easier to write generalized toolkits to encourage software re-use.
The only part of C++ that is noticably difficult to express
in C is "exceptions" -- which were *not* the driving force of
C++ language development [unlike, say, Ada.]
Translating C++ to C is *not* "absurd". The first C++
compilers, designed by the author of C++ himself, was
'cfront', which translated the C++ code into C for
compilation by your nearest handy C compiler. 'cfront'
was managed and distributed by AT&T at the time, and
is still available from Lucent (the vehicle that
AT&T spun a fair bit of their technology off to.)
I found it on lucent's site just yesterday. I happened
to be using an old browser so I couldn't easily check
out the licensing conditions and pricing.
--
"I want to make sure [a user] can't get through ... an online
experience without hitting a Microsoft ad"
-- Steve Ballmer [Microsoft Chief Executive]