Jump to content
  • Advertisement
Sign in to follow this  
benzwong

Java to Visual C++ .NET 2003

This topic is 4888 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
snk_kid: Did you even read about what he was going to do? He is going to write small games and you start to talk about templates, boost and stuff that he doesn't need to worry about. Both c++ and java is OO and for small projects you can easily think exactly the same way and use the same design patterns.


For your purpose, you probably only need to look at the differences in the syntax. Then you have to understand the differences between a pointer, a reference and a value. You can look up the rest when it becomes a problem.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!