Does anybody knows where I can get a Java to C++ Code Converter? A help would be much appreciated guys, thanks in advance!
Does anybody knows where I can get a Java to C++ Code Converter? A help would be much appreciated guys, thanks in advance!
I only know of a Java to C converter. Would that work for you?
How the hell does that work? I mean how would you implement inheritance, polymorphism etc in C?Originally Posted by nickodonnell
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
it's not that hard actually.... it's painful and ugly as hell, but it can be done. In fact, all the first C++ compilers were simply preprocessors to translate C++ to C.Originally Posted by ahluka
you can do it using structures and arrays of function pointers (which is basically what C++ does under the hood).
the only thing that you can't really do is templates (although you can get close with loads of evil preprocessor macros)
That would be much appreciated nick. Please kindly give me a way to get it or you can send it to [email protected], thanks!Originally Posted by nickodonnell
well it would probably be a mess but so is a disassembled .exe
I don't know if it'll work right, but I came across this about a week ago.
http://www.ticalc.org/archives/files...315/31522.html
------------------------------------------------cout<<"Hello World!\n";------------------------------------------------
>>the only thing that you can't really do is templates
basic templates can be done with macros. what you cant do is encapsulation. C has no way of specifying private data.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
true, but encapsulation is a compile-time only mechanism. it has no effect on the generated code (in this case, C).Originally Posted by Stoned_Coder
You're correct that C has no way of specifying access control to data, but it doesn't need to.Originally Posted by Stoned_Coder
The translator would actually be responsible for enforcing access control (eg preventing invalid access to private data). In other words, the translator would refuse to spit out C code if an invalid access to private data is attempted. The C code, if generated, would not attempt such invalid accesses, so the C compiler does not need to check such things.
The idioms of the various languages are fairly different. For some reason I doubt any program around today could produce any code in another language you'd actually want to use.
Readable, maintainable code? not a chance. But if you just want to compile it and use it, there are several programs that do things like that. CORBA IDL compilers, for example, generate C++ or java classes from an interface spec.Originally Posted by orbitz