Skip to main content
GameDev.net gamedev.net
🔒 Locked

Java to Visual C++ .NET 2003

Started by benzwong May 31, 2005 at 4:42 AM 3 replies 700+ views
Original Post
benzwong
benzwong
Hi guys, I'm a java programmer in school for 2 years already. I can say I'm at an intermediate level, where i've already learnt execptions, file i/o, data structures and even java 3D. However, going into my final year of studies, i needed to do some mini games for an external client. The client's game development environment is Visual Studio .NET 2003, and the language is C++. Do you guys out there have any good sites/articles on conversion from java to C++? I know a little bit of C++ and have a basic book about it at home, but I would love to have some sample codes or articles on what to take note when converting from java to C++ programming. Thanks in advance.
snk_kid
snk_kid
You probably wont finding anything like that, in anycase most material online about C++ is very poor. I don't think you need an article like that just learn C++ and the C++ standard library properly and you should know what to do.

You should also realize that any syntactic similarity between the two is where it ends, they really are completely different and you will need to change your mind-set quite abit for C++. What i'm saying is it is not going to be an easy ride as it may appear to be.

One of the more significant differences between the two is java is biased towards reference semantics while C++ is biased towards value semantics and favours the static type system. Another obvious one is Java is in a managed environment alot of stuff is taken care for you while standard C++ is unmanaged.

Don't let comments like "C++ is just C with OO" fool you either because its rubbish these two are quite distinct aswell.

I suggest as you have programming experience, you obtain a bible book:

The C++ Programming Language Special Edition by Bjarne Stroustrup the inventor of the language.

Pay close attention to templates and the C++ standard library in particular, look into the C++ boost library later on too.

[Edited by - snk_kid on May 31, 2005 5:12:54 AM]
Andrew Russell
Andrew Russell
Although I wouldn't look too hard at templates as far as using them for your own project, I highly recomend looking at the standard library (which uses templates heavily).

Things from the standard library and boost that you probably should be using in your project:
std::list
std::vector
std::string
boost::shared_ptr

And possibly other stuff as necessary.

These cover your basic container objects, string object, and a shared pointer (because C++, unlike Java, has no garbage collector).

You can probably work out how to use these things by googling them. If you have trouble, just ask more specific questions here about them.
benzwong
benzwong
woah, wads this thing about template and boost.. lol

anyway thanks for your advice guys, i'll ask more questions on the forums here if needed =)

i'll probably work on my memory management stuff for now..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.