Omnimaga
General Discussion => Technology and Development => Computer Programming => Topic started by: Snake X on November 04, 2011, 09:23:38 pm
-
Well, It's time I learn something valuable in life a little early.. C++! So I found out that one of my friends is making this game with like 3 or so other people and i wanted to help him out.
So, what is the best online tutorial that will help me to learn this language? Also what IDE is the best one? What do I need to download to get started making my first programs?
Thanks as always!
-
I suggest cplusplus (http://www.cplusplus.com/doc/tutorial/) and learncpp (http://www.learncpp.com/). I'm not a master of the language, but I'm using those two to learn it, and I'm using Code::Blocks (http://www.codeblocks.org/downloads/26) as my IDE. If you go with Code::Blocks, I think you only need to download that to get started. cplusplus has a PDF of their tutorial that you can download for offline learning, if you wanted though.
-
cplusplus is probably the best tutorial out there. For an IDE I use code::blocks with MinGW included in the install. :D
-
thank you! Tomorrow i'll probably start on it.
Also, what about tutorials as far as direct3d 9/10/11? Which tutorials are the best ones for that? The reason I wanted to learn about C++ is to work with direct x
-
Just download the DirectX SDK, and open the samples and test things out. The included documentation also helps you quite a bit when looking through the samples (start with the tutorials)
-
ok, thanks! I'll look into it after i learn c++ first tho
-
Just a forewarning, DirectX and OpenGL are highly complex libraries. You may want to start out with something like Ogre3D or the like to learn the basics of 3D Graphics.
-
I also don't recommend DirectX because it's a Microsoft library that only works on Windows. OpenGL is a far better choice, due to having the same power and being cross-platform ;)
-
For a tutorial, I used LearnCpp (http://www.learncpp.com).
For an IDE I used Visual Studio. Visual Studio works great if you are only going to develop for windows, if you are going to develop for other platforms, then code::blocks is probably your best bet. (Ha, now you can't yell at me)
-
For a tutorial, I used LearnCpp (http://www.learncpp.com).
For an IDE I used Visual Studio. Visual Studio works great if you are only going to develop for windows, if you are going to develop for other platforms, then code::blocks is probably your best bet. (Ha, now you can't yell at me)
As soon as I saw you replied I thought "Brace yourself, he just recommend Visual Studio!". But this time you did it well.
Another advantage of Code::Blocks is if you use it on Windows, and then have to use Linux or Mac for something else, then you are accustomed to the IDE already ;)
-
No troll, but, the best IDE ever is emacs or vlm.
Using all this kind of IDE makes you forget what you're doing.
-
Whatever you use, don't forget to ask questions here if you need help on something. :D (Answering C++ questions makes me feel useful here, lol) :P
-
ephan, problem is, is that my friend is working on a game that uses direct x 9. Also i like direct x. A lot. lol
Ok another question:
how would I make a multi-core "hello world" program?
For example, I would want 1st core to print "Core 1 says Hello world!"
2nd core would print "Core 2 says hello world!"
and etc, all of which is printing out to the console (command prompt i thin)
-
To do something like that, you would need to make multiple threads. I'm using Linux nowadays, so I would recommend the pthread library. I'm pretty sure VS has it, and I know Code Blocks has it. Just include pthread.h. Look on Wikipedia for some quick example code.
Also, you can't force the program to make a thread run on a specific core. You just have to trust that it will do it's job (the same goes for all threading libraries).
-
Cplusplus is actually used by my high school.
And with more complex threading, you have to keep in mind certain timing issues, such as that sometimes (not usually) core 2 responds first, which could really screw with you in some situations.
-
well thats fine, just as long as it can display the text really
edit: i found out that pthread.h is linux only.. which one is the windows version?
-
Apparently it doesn't have its wn lib: Here's a tut.
http://msdn.microsoft.com/en-us/library/ms810438.aspx
-
Ok well the tutorial from cplusplus isn't working out for me as of this moment.. I gotten to as far as pointers with functions but then it just started to make no sense to me and i feel like it wasn't explained that thoroughly. It was "targeted" for people who had no prior coding experience but i don't think that is the case.. lol
-
What part about pointers or functions are you having trouble with? Perhaps we could explain more in depth?
-
Ok well the tutorial from cplusplus isn't working out for me as of this moment.. I gotten to as far as pointers with functions but then it just started to make no sense to me and i feel like it wasn't explained that thoroughly. It was "targeted" for people who had no prior coding experience but i don't think that is the case.. lol
I was already a programmer when I read it, and it was just fine, it's what made me understand pointers for life, and English isn't even my main language.
Secondly, if it was written for people with no prior coding experience (as you stated), then it should also be just fine for programmers. It would be awkward for non-programmers to read a text targeted to programmers, though.
Nevertheless, as HOMER-16 said (http://ourl.ca/13819/260020), what didn't you understand? We might be able to explain more "thoroughly".
-
Pointers work the exact same way as they do in axe, if it helps.
-
Pointers work the exact same way as they do in axe, if it helps.
Well, except that adding to a pointer will automatically multiply by the size of the data being pointed to. No difference if it's a single byte pointer, of course.