From: Peng Yu on
I want to convert C programs to C++ programs. I found this tool
http://www.scriptol.com/scripts/ctocpp.php

But I'm wondering if this is the best tool to convert C programs to C+
+ programs.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Seungbeom Kim on
Peng Yu wrote:
> I want to convert C programs to C++ programs.

Most C programs are also C++ programs themselves, except that some
identifiers (such as 'class', 'delete') may conflict with keywords.
C++ does not require its programs to use certain style (such as
object-oriented) or features (such as classes).

What does it mean to you to convert C programs to C++ programs,
and why would you want to do it?

--
Seungbeom Kim

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Jens Schmidt on
Peng Yu wrote:

> I want to convert C programs to C++ programs. I found this tool
> http://www.scriptol.com/scripts/ctocpp.php
>
> But I'm wondering if this is the best tool to convert C programs to C+
> + programs.

The best tool is a project team creating the C++ program from the
requirement specification. Especially a team knowing about OO design
and implementation.

Other tools probably result in a C program written in C++.

There is a famous saying:
"You can write FORTRAN in any language".
--
Greetings,
Jens Schmidt


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Francis Glassborow on
Peng Yu wrote:
> I want to convert C programs to C++ programs. I found this tool
> http://www.scriptol.com/scripts/ctocpp.php
>
> But I'm wondering if this is the best tool to convert C programs to C+
> + programs.
>

Possibly once you are clear in your mind what you are trying to achieve.
Personally I would either leave the code alone (apart fgrom dealingf
with name/keyword clashes) or I would want to rework the code fgor myself.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Thomas Richter on
Peng Yu wrote:
> I want to convert C programs to C++ programs. I found this tool
> http://www.scriptol.com/scripts/ctocpp.php
>
> But I'm wondering if this is the best tool to convert C programs to C+
> + programs.

Well, there is typically not much to "convert", however, a good C
program, even with the minor adaptations to be a valid C++ program,
makes still not a good C++ program. For example, while "malloc" is
certainly a valid C and C++ function to allocate memory, and while it
certainly works alike in C and C++, a good(!) C++ program would rather
allocate objects via "new" and not "malloc". In C++, you would need an
additional cast there (from void * to the target type), but that's it.

Thus, what are you trying to do?

So long,
Thomas

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 |  Next  |  Last
Pages: 1 2 3
Prev: goto
Next: Template: Specialization Help