ctocpp translator
does anyone here have the ctocpp translator that is supposed to be in this page? http://www.scriptol.com/ctocpp.php
if you do, can pass to me? thanks
What on earth does that do ? if it ''converts'' c code to cpp code, you don''t need it as c code must compile correctly on a c++ compiler - ie you don''t need it if that is what you want to do
quote:Original post by Anonymous Poster
if it ''converts'' c code to cpp code, you don''t need it as c code must compile correctly on a c++ compiler - ie you don''t need it if that is what you want to do
I''m not sure that''s true, as the Quake 2 source code nearly exploded last time I tried to compile it as C++...then again, this was MSVC6, I dunno if it''s standards non-compliance stuff matters. Even so, I seriously don''t think that''s true.
quote:if it ''converts'' c code to cpp code, you don''t need it as c code must compile correctly on a c++ compiler
Bollocks.
quote:Original post by Anonymous Poster
if it ''converts'' c code to cpp code, you don''t need it as c code must compile correctly on a c++ compiler
try this in c++ then and be amazed about the things that arent allowed in c++ anymore (though one might argue if for good reason):
isOdd(var){var%2;}
quote:Original post by DrPizzaquote:if it ''converts'' c code to cpp code, you don''t need it as c code must compile correctly on a c++ compiler
Bollocks.
Dr "Subtle" Pizza, I presume? I believe what he meant to say was that, as, quite often, compiling code from one ''C'' compiler to the next requires a few changes, is it not likely that moving from a ''C'' to a ''C++'' compiler will require more changes? Maybe yes, maybe no, but don''t count on it working first time.
Ben H
quote:Original post by Hinch
Dr "Subtle" Pizza, I presume? I believe what he meant to say was that, as, quite often, compiling code from one ''C'' compiler to the next requires a few changes, is it not likely that moving from a ''C'' to a ''C++'' compiler will require more changes? Maybe yes, maybe no, but don''t count on it working first time.
More likely what he meant to say it''s just not true. While C++ is mostly a superset of C, it is not strictly so; there is a good deal of perfectly valid C code that is not valid C++ code at all. Some of this is because C has evolved (C99 is more recent than the C++ standard, after all!), some because C++ enforces a much stricter type system, et cetera.
eg. The following is probably valid C code, but not C++, for 2 reasons:
struct class {
int template;
};
[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
struct class {
int template;
};
[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement