Jump to content
  • Advertisement
Sign in to follow this  

Question about C++

This topic is 4740 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

What concepts of C++ are needed for programming games with SDL? I have a 1000 page book on C++, are there any topics worth skipping?

Share this post


Link to post
Share on other sites
Advertisement
what about overloading operators and stuff like that? Is that even used when programming games?

Share this post


Link to post
Share on other sites
SDL is written to be usable with C. Therefore, you can skip anything in C++ and not C:
classes, templates, STL, exceptions, namespaces...

You will have to learn functions, pointers, and structs.

The more C++ you learn, however, the easier your job will be...

Share this post


Link to post
Share on other sites
To be honest i think your trying to jump the gun especially if this is going to be your first programming language. If that is the case C++ is not particularly good beginners language in anycase. Its not a language to be taken lightly either it will take you about 2 years to really know it even then i'm serious that one book just isn't enough. All at the same time you need to learn general programming concepts and design by practicing with making console apps, at some point algorithms and data structures.

Sure you don't need to use all features of C++ but consider this those gaps of knowledge you leave out will most likely mean you'll end up doing something like reinventing the wheel to only turn to be a flat tire, at least know whats available from the language.

If your really going skip sections then i would advice you at the very least don't skip learning abit about how to use the C++ standard library (containers & generic algorithms, utilities, I/O streams etc), be aware of whats available in it it will save you in the long run trust me.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
[edit: see below - AR]

[Edited by - Andrew Russell on May 30, 2005 12:36:57 AM]

Share this post


Link to post
Share on other sites
I concur with the above. You should at least browse through all of the sections, so that when you come back for help, the terms are at least not completely new. You'll be saving yourself tons of time later if you learn the entirety of the book now, rather than developing bad habits now, and unlearning them as you learn the "advanced" topics later.

Share this post


Link to post
Share on other sites
Silly forums decided it would be fun to log me out *gets out the forum-beating stick* [grin]. See the AP above. This is my post:


1000 page book!? Woah.

First job - I think you should probably get a shorter book for a nice introduction (I don't know what book you have, but 1000 pages seems to be overkill).

(Point 1.a - It may be a good idea to learn an eaiser language first - it's not strictly necessay, it's up to you. BASIC may suffice. Just don't try to learn C before C++. Bad plan and waste of time.)


Second - These are things you can safely skip to begin with. You will be touching on many of these as you use libraries, but for your own code it's not strictly necessary that you be able to implement things that use these features. Learn these, but you can safely learn them last.

- Templates
- Multiple Inheritance
- Namespaces
- Function Pointers
- Operator overloading (at least, the complicated stuff)
- Const correctness
- Keywords like inline, friend, mutable, volatile, typename, and even more obscure ones I can't list off the top of my head


Here is a list of stuff that you will find is highly important (although wait until you've done basic functions and arithmatic and so on; ie "hello world"):

- Classes and structs
- Inheritance (the basics) and virtual functions
- Pointers and references
- Standard library stuff (try to use C++ standard library over C stuff where possible)
- std::string, std::vector and std::list in particular.


To complement your book, here is a website I like. You will find others too. [link].

C++ is not an easy language to learn (as snk_kid says - 2 years or more for an "ok" understanding), but once you know it, it is very rewarding. Good luck.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!