470,849 Members | 1,098 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

c or cpp for extension

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
Feb 17 '06 #1
6 884
>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.
br**********************@hotmail.com
Remove only "_nos_pam"
Feb 17 '06 #2
>Bottom line question, does using cpp for for an non-OO program bring with it
any penalty?


It shouldn't do.

Dave
Feb 17 '06 #3
great, thanks
"Bruno van Dooren" <br**********************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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.
br**********************@hotmail.com
Remove only "_nos_pam"

Feb 17 '06 #4
thanks

"David Lowndes" <Da****@example.invalid> wrote in message
news:i7********************************@4ax.com...
Bottom line question, does using cpp for for an non-OO program bring with
it
any penalty?


It shouldn't do.

Dave

Feb 17 '06 #5
academic wrote:
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
Feb 18 '06 #6
I'll look into that
thanks

"Tamas Demjen" <td*****@yahoo.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
academic wrote:
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

Feb 18 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Gyger | last post: by
8 posts views Thread by Torsten Mohr | last post: by
3 posts views Thread by man-in-nature | last post: by
5 posts views Thread by Jeffry van de Vuurst | last post: by
4 posts views Thread by pepcag | last post: by
6 posts views Thread by tommybiegs | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.