473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

mixed c / c++ files

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.

Thanks for your advice,

Vu
Jul 22 '05 #1
4 1249
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.

Jul 22 '05 #2

"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++ ?

Vu
Jul 22 '05 #3

"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
Jul 22 '05 #4

----- Original Message -----
From: "John Harrison" <jo*************@hotmail.com>
Newsgroups: comp.lang.c++
Sent: Tuesday, May 11, 2004 10:51 AM
Subject: Re: mixed c / c++ files


"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.

Thanks. That's what I need to know.
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?

Oh yes, I can :-)

Thanks,

Vu
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: Niels Berkers | last post by:
Hi, i'd like to host my web pages using multiparts to reduce the number of hits on the server. i know this isn't a real PHP subject, but i'll try it anyway. i've been searching the web for...
7
by: Staale L. Hansen | last post by:
We have an application which uses some mixed-mode code to expose a .NET 1.1 managed API. Only the necessary files are compiled with /clr. We want to be able to load the application without .NET...
0
by: crafuse | last post by:
Hello all, I'm trying to create a mixed DLL using VC++ .NET 2003. Specifically, I have some TAO CORBA .cpp files that I wish to include as native object code in the DLL and some managed classes...
4
by: quortex | last post by:
Hey all, I have been working on a project which consists of Native C++ code and managed C# code. In order for the managed C# code to be able to access the native layer I wrap some objects using...
7
by: | last post by:
All, I have a MFC Mixed mode dll which is working well. I am now tring to use a regular C++ class from another DLL which has a method called GetMessage. When I link I get 2 error messages: ...
5
by: DFB | last post by:
I am the author of the ZLibNetWrapper project on SourceForge (located at zlibnetwrapper.sf.net). This project is a simple mixed-mode .NET wrapper around the ZLib compression library. The ZLib...
10
by: ajtaylor | last post by:
Hello, I have a load of native C++ code that I want to use in a CLR class library. My "logic" being that I create a C++/CLI managed class that acts as an interface to the unmanged code. I...
7
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
I'm new to working with mixed assemblies. All of my previous experience has been with VC++/MFC in native, unmanaged applications. When I create a mixed assembly in which one or more of the files...
5
by: =?Utf-8?B?aWduaGVucnk=?= | last post by:
I have a managed C++ project and two C# projects. All are class library projects. The C++ project links with native C++ static libraries and references to one C# project. The projects structure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.