c or cpp for extension

  • Thread starter Thread starter academic
  • Start date Start date
A

academic

I am writing a program that is not OO.

I tried using the c extension but that has too many restrictions (for me).

So I changed the extension to cpp and wonder if the compiler is simply more
allowable or am I getting some other overhead that I don't know about.

Bottom line question, does using cpp for for an non-OO program bring with it
any penalty?



Thanks
 
I am writing a program that is not OO.
I tried using the c extension but that has too many restrictions (for me).

So I changed the extension to cpp and wonder if the compiler is simply
more allowable or am I getting some other overhead that I don't know
about.

Bottom line question, does using cpp for for an non-OO program bring with
it any penalty?


If you use only the C subset, and basically use CPP as a flexible C, then
there will be no noticable overhead.
to verify this, build a simple program, and compile it as C and as C++.
you can then compare exe size and execution speed.

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 
great, thanks
Bruno van Dooren said:
If you use only the C subset, and basically use CPP as a flexible C, then
there will be no noticable overhead.
to verify this, build a simple program, and compile it as C and as C++.
you can then compare exe size and execution speed.

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 
academic said:
Bottom line question, does using cpp for for an non-OO program bring with it
any penalty?

You may want to disable some C++ language features to remove penalty
associated with them, such as exception support and RTTI.

Tom
 
I'll look into that


thanks

Tamas Demjen said:
You may want to disable some C++ language features to remove penalty
associated with them, such as exception support and RTTI.

Tom
 
Back
Top