954,141 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Tool Needed

Hi

i want to convert my C project to C++. so does anyone knows any tool that converts a C program to C++

vivekgalatage
Newbie Poster
6 posts since Aug 2004
Reputation Points: 12
Solved Threads: 0
 

The Brain - the one and only

FireNet
Posting Whiz in Training
258 posts since May 2004
Reputation Points: 108
Solved Threads: 7
 

Hello,

You shouldn't need it, unless you have a bunch of libraries, or are using depreciated methods to implement your thingy. C++ is an extension (add-in) to C, and you can get printf and a bunch of other functions to work just fine within it.

Now, if you are looking for unified code, then I think it is going to be a manual process indeed. IN that case, you could convert your libraries one at a time, as they should still link fine. I am not aware of any big hiccups here.

Christian

kc0arf
Posting Virtuoso
Team Colleague
1,937 posts since Mar 2004
Reputation Points: 121
Solved Threads: 57
 

Compilers are usually set up to compile files with ".c" extensions as C and ".cpp" as C++; so if you are going to add C++ only stuff, the first thing to do is rename your .c files as .cpp. (and update the project file accordingly)

Once you do that, you should be able to build and run, and then you can incrementally add/change things to use C++ syntax extensions.

Chainsaw
Posting Pro in Training
436 posts since Jun 2004
Reputation Points: 36
Solved Threads: 11
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You