Tuesday, July 28, 2009

Is there any software for converting "c" to "c++" programs & vice versa?

T Subash try this link my friend





http://www.ezgoal.com/channels/developer...

Is there any software for converting "c" to "c++" programs %26amp; vice versa?
ahhh!!! simple ... change ur file extensions from (.c) to (.cpp)


c:\%26gt; ren *.c *.cpp





now the serious part ..





I dont know if any s/w available for that but u can urself make a program in c/c++, where u can program to open a (.c) file, convert printf %26amp; scanf statements into cout %26amp; cin, with a proper logic and then rename the file with (.cpp) extension.


dont forget to add an " #include%26lt;iostream%26gt; " statement.


I suppose nothing extra is required ..


Its quite hard to programm it but once u make it, u will feel proud .....LOL


but i know u will look for a short cut (ready to use programm)


and i would lose my 8 points ...
Reply:u can convert it if its not very big project
Reply:Basically C is a structured Programming Language, but C++ is Object Oriented Programming Language(OOPs). So, there is totally a different approach to be adopted to code in c++. no software could convert c++ to c. but c programs can run fine in c++.
Reply:in most cases in C++ there are libraries that you can include to use 'most' c functions. If you have the ability to compile one, you should have the ability to compile the other though. i dont really see the purpose in converting them.
Reply:I doubt it, as it would be impossible to convert most C++ programs to C, as it can't handle the object-oriented stuff.





As for C to C++, for the most part it should be fine as it is - C++ is just C extended - hence the "++".





Rawlyn.


No comments:

Post a Comment