Few qustion - any expert C++ programmer help me!

Hello there, i am programmed in c++ for a while and left it for like few month now i have come back.. i really enjoy and soon ill upload code for a game i made to see your opinion on the code it self..
for this topic i have few questions:
1.if i start programming which language c++/java? what c++ better than java and the opposite?
2.which lib is better ("best") for 2d games.
3.which lib is better for 3d games.
4.assuming my aim is to be game programmer or just expert c++ programmer for developing software which other language should i learn that go with c++ and how do i combine them?
5.sql is database lang that works with c++? lets say im building a game sql can support database for this game?
6.how do i program c++ on outside processor for outside computer project?
7.does c++ support application for Iphone/android? and how?
i know that is a lot of question but i feel more comfortable to ask all know and know all now before i move on thanks for everything hope you will able to help me
1) c++ is more flexible. Java effectively took c++ and removed a lot of its features while adding almost nothing of note to make up for it. But java works on all computer systems with minimal re-work, c++ is prone to having to be reworked a bit if moved to another operating system if not careful from the start to avoid it.

2/3 ... windows is still the main real gamers computer, and that makes directdraw and directx a good place to be. This ties into #1.. do you need to play it on macs and unix?

4) Anything, really. I used to say learn an assembly language, not because you will use it much, but because you CAN use it, you can read c++ compiler spew a bit, and you will understand how the computer works better. But you are not likely to code in it much these days; there are a few tricks like intel's cpu instructions contain a 'endian' flipper that is useful or you can steal hardware timers for high precision work. Perl, c#, java, python might be good to pick up. Learn to shell script/batch file also.

5) Sql is not really a language. It is used by most databases but it is different for each database, though simple commands don't change a lot of other syntax does. Its simple, and its aggravating... learn it on demand, but don't focus on it unless you want to be a database guy. You can use sql with almost any language, and if not, you can call the command line sql tools on your computer from the language instead. JavaScript might prevent sql use, as it has some limits to discourage hacker code put in web pages.

6) Question is unclear. Embedded computers? Those will have their own compiler, and you compile the code on it and it then works on that device. Many embedded computers are just PCs now; I used to work on pc-104 systems, and they are smaller than ever now. Your phone is probably better than my first desktops by orders of magnitude.

7) Don't know, but I am just going to assume yes. You probably just need a toolkit that targets the platform. I am not aware of ANY major systems that don't have C and C++ to some extent available. I don't even own a big brother device, so I am of limited usefulness talking about phones.





re #7, some vendors (e.g. DropBox) end up rewriting their apps in C++ because C++ is, ironically, more portable than Java etc. Then they can have a single codebase across all mobile targets, with just the UI different. There was a CppCon16 talk (mostly live demo) showing how to deploy and debug C++ apps on android and iphone using Visual Studio, though that was a bit raw. I think there are other cross-platform mobile native dev environments, too - I don' t know, never worked in mobile market (or in games, for that matter)
Last edited on
I remember a SDK for visual for one of the phone targets ... presumably its out there, whether its free or not, I do not know.

Okay thanks for your answers i have more few questions
1.which code i should use on header file and which code i should use on cpp file
2.what is the advantage to write few cpp files instead whole game/code in 1 cpp file?
3.if i write 3 cpp files how do i combine them to one?
headers have definitions of classes, functions, constants, and such.
cpp files have the actual code that does the work.
Template classes are special and go in the h file, or mostly, can't recall all the rules there.

splitting big code into logical chunks helps you find things faster, understand it better, and you can modify one part without touching another, multiple people can work on one project together, and more. Imagine a 5+ million line single source file ... a lot of code is this big ....

project in your IDE manages the multiple files. You don't need to do much beyond add them to the project.
Topic archived. No new replies allowed.