"Vu Pham" <vu@sivell.com> wrote in message
news:2g************@uni-berlin.de...
"Rolf Magnus" <ra******@t-online.de> wrote in message
news:c7*************@news.t-online.com... Vu Pham wrote:
I have a project that has at least one c++ file and some other c
files.
Could you please advice which one is better ( in performance ) ?
1. Convert all c files to c++ file by renaming the extension,
undeclaring the extern "C" , and code is unchanged.
2. Put as much code as possible to c files and have mixed c/++ files.
I don't see why this should have anything to do with performance.
Sorry for my ignorance. Is there any difference ( in performace ) between
c and c++ ?
It depends on the compiler, and the code being compiled. Maybe C is faster,
maybe not. Any difference will be so small, that almost probably you should
be thinking about which will mean less work (now and in the future) not
which is faster.
Also bear in mind that not all C code will work the same when compiled as
C++ (some C code won't compile at all as C++), so I would say choose the
option that means the fewest changes. Why can't you just leave everything as
it is?
john