Converting some c++ files to java files?

Started by
4 comments, last by NightMarez 18 years, 4 months ago
Hi there :) Im looking at some cryptation files for network in c++ that uses memory map and stuff, that i need convertet to java. however, its giving me alot of headacke, and i was wondering if anyone in here would be interrestet in lending me a hand converting them? its not alot of code, some of it is already convertet, but now im kinda stuck. the code is here (4 c++ files, 3 java files i been working on) : http://www.freeplay.dk/ls/ctoj.zip if you convert them, mail them to me please to : admin@freeplay.dk many thanks to ANY help you can give.
Advertisement
You cannot convert C++ to Java. The featuresets are too different. In all of the cases I have seen where someone takes a .cpp file and tries to edit it into a .java file, they end up spending more time and ending up with a crappier result than if they rewrote using the same overall structure.
hum okay, i got told you can, you just need to fix the variables like

unsigned long in c++ is long[] in java and so on.

and i did already rewrite alot of it, just the last parts giving me problems.
Rather than trying to port Blowfish yourself to Java, first try and see if it has already been done. Start with that and if you can't find anything you need, then go on with trying to port it over. Good luck!
Depending on what your exact needs are, you might also want to consider using the JNI (Java Native Interface). This allows you to call C/C++ code directly from Java.
Thank you, ill try JNI and create a c++ dll file.

This topic is closed to new replies.

Advertisement