0

Correct me if I am wrong, but in one book I have read that every C++ program is converted to C while it is going through different compiling phases.

I just want to see the C code.

Can any one tell me how to view that code?

dnl-blkv
  • 2,037
  • 1
  • 17
  • 22
nikhil mehta
  • 972
  • 15
  • 30

1 Answers1

3

Search for CFront for the answer to your question; Wikipedia has a good summary

C++ started out as a C code generator called CFront, but this was abandoned in 1993. Since then, all C++ compilers have been normal compilers, not C front-ends. Exceptions were the original difficulty, but there are weird corners like the subtle difference in the meaning of "void" that would be awkward too.

It is a good approach to learning C++ to think "What would the C equivalent of this be?", but you can no longer generate it from the compiler, sorry.

Edit: some people are commenting that there are products available to do what you want. I was unaware of these. I would say that although this is what you want, it probably isn't what you need. If your aim is to understand C++, read about C++.

Tim Band
  • 576
  • 4
  • 4