Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / I want to learn C++

Author
Message
Slayer267
14
Years of Service
User Offline
Joined: 6th Sep 2010
Location: Non of your beez wax
Posted: 25th Apr 2012 04:34
Does anyone here know any books I can buy to get started with C++? Maybe a website?

Software Maybe?

Your signature has been erased by a mod; it needs to be no larger than 600x120.
Travis Gatlin
16
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 25th Apr 2012 04:42
http://www.cprogramming.com/

This website helped me write my first script by myself in an hour. Very excellent. I'd suggest it. Good luck!

http://www.talenthouse.com/travisgatlin
You can find my latest work here. Please comment on my work and tell me what you think!
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 25th Apr 2012 06:22
That and cplusplus.com (i think that's the URL).

Be warned though, C++ is a whole different beast from basic. I couldn't wrap my head around OOP's polymorphism/inheritance/classes until I took a highschool course on java. I've never looked into it, but you might just want to go through C tutorials first, then look in to C++.

As for IDE's/compilers, I like code::blocks/mingw if you're looking for something no-strings-attached, but the only reason to use it is if you're not eligible for the microsoft dreamspark program (which gives you access to visual studio free, few strings attached). They want you to give a .edu email address to verify you're in school, but I emailed them and they gave me an access code, so I think it's really easy to get in.

Yodaman Jer
User Banned
Posted: 25th Apr 2012 07:17
@travis:

That link is amazing! Totally going to use that to learn C++ in the future. That guy is amazing at writing tutorials!

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 25th Apr 2012 07:42
If you already know you way around DBPRO pretty well, and want a stepping stone to the other side, then Dark GDK is a logical option.

zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 25th Apr 2012 10:16
Here's my 2 cents,, and don't be shocked that if it doesn't even stretch that far.

Put in the work to really understand the core language. Move on, only when you are sure you get what is discussed in the tutorial, or chapter in a book. Have other reference material available, and be willing to back up, if something doesn't make sense to you (or at least make a note of it, and take the time to clear any confusion before plowing into too many walls). Deal mainly, and for the most part, with console apps. Don't dive right into an API, or windows programming so early on; there is plenty of time for that.

(I don't mean that you can't or shouldn't look into API's like DirectX or graphics libraries, or browse some advanced texts like the "Gems" series at all.... just don't let it confuse you or deter you from working steadily on & building a solid core foundation).

After you have worked your way through a definitive text like "Object Oriented Programming in C++ ~ LAFORE", (I'd also like to recommend a reference like "C++ in Plain English ~ Overlaand" to aid in getting to the point fast, when necessary). Be familiar with the STL (Standard Template Libraries),, then move on to books that cover more specific topics to gaming like "C++ for Game Programmers" or (or whatever interests you, for instance "Windows Programming C++ ~ Henning & Hansing").

Get comfortable and take the time to learn about your compiler. Read Primers on properly setting up your environment, linking Libraries, error reporting settings etc... It will save you a lot of grief.

If gaming becomes your aim, I believe it's fine to work through texts that provide specifics of say how to begin building a 3D Engine with Direct X (take the LaMothe series (even if they tend to leave you hanging much of the time, and each book spends about 1/3 to 1/2 covering what every other book in the series covers)... If for nothing to gain an understanding of what is involved,, but don't be surprised or feel it's cheating to use an engine that has had years/and highly skilled programmers & solid support communities. You don't want to spend all your time reinventing the wheel, or being left behind as things move and change at a rapid pace. It will almost futile to start from scratch and get an engine to the level of those that are out there, and have the time to do anything with it. It's nice to know what goes into everything, just don't think that while you gain knowledge and experience that you have the time to do everything alone. It honestly doesn't work out well.

That's all I have for now. Best Regards!

.oO()Oo.oO (I'm not a real programmer,, I just play one on the Forums!!!) Oo.oO()Oo.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Apr 2012 12:28
My experience:

Just get on with it.

Start with a OpenGL sprite demo, and plug away at it. The language itself is just syntax, syntax and obfuscation. See you don't necesserily have to know very much about C++ to use it. Once you know the syntax, you can apply game logic, you can learn GL stuff as you go. But the important thing is to actually be doing something that you WANT to see happen. Really do you need to see ''Hello World'' in yet another language?
I know a lot of people use pre-built game engines and libraries, but I'd say learning some OpenGL is more important.

You would be surprised just how quickly you can get into using C++ based just on knowledge of game logic with DB, and a clear example. Don't procrastinate, don't think for a second that you have to understand something in order to use it. Your into making games right, so concentrate on the game making aspects. Game logic is a layer above everything else, in my project the logic in the DBPro version and the iOS version is pretty much identical, bar syntax.

In DBPro, to wrap a >1.0 float:

While v#>1.0 : dec v#,1.0 : Endwhile

In C++

while ( v > 1.0f ) v-=1.0f;

It's really not rocket surgery - I assumed it was for a number of years, but just getting stuck in changed that perception on day 1.


Now I'm not saying my opinion here is very wise, but it's effective, that's all I can say. If you start by learning the language, you might just give up - I started by reading some tutorials, console stuff, and it might just be my brain, but I found it as dull as hell. Necessity fuels learning, and with a language like C++, you need fuel - that's all, just an ambition to get whatever is in your head, onto the screen. If you have that perspective, then you will learn the things you need. Necessity see - if you need to do something that you've never done in C++, just look it up, look for peoples code. Once you look at the code, you'll see that it's quite straightforward. For example, something you might dread, say working out an angle from 2D vectors, you might rely on the DBPro Atanfull command - major difference in C++ is that it's Atan2f. So long as you know how to work with radians (or at least be able to convert to angles) it's all there, sometimes it's only syntax.

I see too many C++ projects that are stuck in procrastination hell, people start by making their engine... big mistake - C++ is not interesting enough for that to be plausible, you need to have something you want to see happen, you should need a feature before you add it - engine and game logic go hand in hand when your learning. Get this - people who write game engines tend to have a CS degree, they get taught completely differently than someone teaching themselves. C++ books are written by people with CS degrees, they spent 4 years learning C++ in a classroom with other people learning C++, and tutors and all that. Your self teaching, self taught people tend to absorb information in small chunks depending on necessity.

Zen might think this post is somewhat dismissive of his, but it's just my point of view, the minute I stopped trying to learn the language and started using the language, well I started learning the language - Necessity fuels learning. Things you need to know, you'll need to know, and when you need to know you'll learn them. If you don't necesserily need to know, then why bother learning . My experience dictates that I just don't learn how Zen suggests, I'm filling in the blanks and assuming that the primary focus of learning C++ is for game development, in which case he should take advantage of the shortcuts and try to keep it interesting, mainly don't get bogged down, don't pay too much attention to programming book authors.... coders can be quite arrogant, some C++ books are more like a list of demands and entry requirements. That's what I mean by obfuscation - don't become a C++ sheep, do things your own way.

I think the important thing is to do whatever is most effective for you. Code your own way, and learn-to-code your own way. You might not end up as a proficient C++ coder, but ending up with a completed project is far more important, I know a few proficient C++ coders who have never finished a single project - What's the point in that!

The programming world is changing, C++ is not going to be top dog forever, languages are evolving into more visual, and logical systems. 20 years ago we only really had Assembly, and development in that was cumbersome, took a lot of planning, but was necessary to get the required frame rates. Now C then C++ took over - not because they are faster, but because they are easier and faster to develop, and they can be ported to different platforms. We already see scripting taking over in the major engines already, god only knows what the next generation of engines will bring.

Health, Ammo, and bacon and eggs!
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Apr 2012 13:00
Quote: "Get this - people who write game engines tend to have a CS degree, they get taught completely differently than someone teaching themselves. C++ books are written by people with CS degrees, they spent 4 years learning C++ in a classroom with other people learning C++, and tutors and all that. Your self teaching, self taught people tend to absorb information in small chunks depending on necessity."


I was making engines for my games in C++ before I started uni. Though I agree that when you're learning this isn't a very good idea, I would say that C++ is so powerful in it's ability to make extendable, scalable software that it would behoove one to use it that way.

"everyone forgets a semi-colon sometimes." - Phaelax
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 25th Apr 2012 13:48 Edited at: 25th Apr 2012 13:50
Depending on what you're trying to get out of c++, I'd recommend a different language altogether.

C++ definately has it's uses, but it's being superceded by much more useful languages. If you're making games, I'd say consider c# or objective-c. If you're making software (like websites or server-type concurrent apps), perhaps give Go a look over.

If you want to program hardware at a low level, c++ might be your best bet, but clang with c, c++ or obj-c offers easy porting.

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Apr 2012 13:49
Quote: "You would be surprised just how quickly you can get into using C++ based just on knowledge of game logic with DB, and a clear example. Don't procrastinate, don't think for a second that you have to understand something in order to use it. Your into making games right, so concentrate on the game making aspects. Game logic is a layer above everything else, in my project the logic in the DBPro version and the iOS version is pretty much identical, bar syntax."


That sounds like very good advice. I know someone sitting in front of this PC who should take it.
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 25th Apr 2012 14:08
It's probably already been mentioned up there ^ already, but if you're comfortable with Dark Basic Pro then the easiest way to learn C/C++ is to move over to Dark GDK. That way you can slowly pick up C/C++ (especially the C++ side) as you go along and start getting a little more relaxed with the language. Dark GDK calls are all the same as Dark Basic Pro so you already have the engines command syntax behind you.

I keep mentioning ANSI C, it's small and very easy to pick up the basics. Although very few people mention it. There's less to learn with ANSI C than there is with the core commands in Dark Basic Pro. Mix the power of C with the GDK engine and you can almost do anything.

That, and GDK comes with examples to get you started.

C - ANSI C - C++ Cheat sheets Lost the other link but this one has them.

ANSI C cheat sheet is a mere 2 sides of paper to learn. And that is all you need to get started with Dark GDK. Good luck!

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Dar13
17
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 26th Apr 2012 01:01 Edited at: 26th Apr 2012 01:02
Quote: " If you're making games, I'd say consider c# or objective-c."

If you're making games, only consider using C# if you're going to stay away from .NET with a ten-foot pole. In fact, avoid .NET at all costs. Obj-C is a good alternative, but is interesting to set-up for a Windows environment.

C++ may be superseded by some other languages in functionality and ease-of-use(I sure would hope so, C++ isn't particularly nice to users), but for pure performance C/C++ can't be beat until you start getting to Assembly and maybe some well-coded FORTRAN/COBOL. That performance advantage is the reason why C/C++ is so popular for games, where the need for every ounce of performance available has to be balanced against usability.

I've heard Clang is a decent alternative to the stalwart GCC/MinGW/MSVC compilers, but I've also heard that the generated executables can be slower than GCC-generated executables.

heyufool1
16
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 26th Apr 2012 01:17 Edited at: 26th Apr 2012 01:19
Nice to hear that you want to learn C++, and aren't being forced to. It is definitely not as hard as people make it out to be. Just don't go jumping into any crazy open source programs yet, and I would suggest staying away from everything but DarkGDK for games, for now. DarkGDK isn't the greatest for game development, but most (if not all) other options require enough C++ knowledge that it can easily scare people away. I suggest starting with DarkGDK so you can fully understand the use of Object Oriented Programming and how to set up a functioning game, and then delve into some more impressive libraries/programs.

http://www.cplusplus.com is amazing for looking up various functions and syntax related stuff, but not so great for tutorials.

Travis's link, http://www.cprogramming.com/ is great for tutorials though so start there

"So hold your head up high and know, it's not the end of the road"

DevilLiger
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 26th Apr 2012 10:18
Interesting, I am in the process of relearning C++ and also looking up OpenGL for Linux platform. If Unity 3d fully supports Linux someday than I would of just gone to Unity, but oh well.

Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 26th Apr 2012 22:06 Edited at: 26th Apr 2012 22:08
Quote: "If you're making games, only consider using C# if you're going to stay away from .NET with a ten-foot pole. In fact, avoid .NET at all costs. Obj-C is a good alternative, but is interesting to set-up for a Windows environment."


Objective-C is the most terrible language I've come across in a long time. The whole language feels like bits of unrelated syntax joined together without even the slightest attempt at consistency. C# on the other hand is an extremely well designed language and I have no idea why you hate .net so much: it has one of the fastest garbage collectors available and .net applications can even be run cross-platform with mono. It did have some performance issues early on but those are mostly gone.

[b]
Dar13
17
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 27th Apr 2012 05:21
Quote: "It did have some performance issues early on but those are mostly gone."

I only said avoid it because of those performance issues. If those have been cleaned-up then that makes C# a good choice for games.
And it's not so much that I hate .NET, I think the garbage collection is fantastic, but I didn't think it would be appropriate for games due to my aforementioned perception of performance issues.

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Apr 2012 13:23
Quote: "Objective-C is the most terrible language I've come across in a long time. The whole language feels like bits of unrelated syntax joined together without even the slightest attempt at consistency. C# on the other hand is an extremely well designed language and I have no idea why you hate .net so much: it has one of the fastest garbage collectors available and .net applications can even be run cross-platform with mono. It did have some performance issues early on but those are mostly gone."


Like +1.

Obj-C is horrid. '@' is probably the ugliest thing on my keyboard and they put it all over the damn place. C# is an easier language than C++, but XNA is more difficult than DarkGDK, so it's a tricky choice. But maybe DarkGDK.NET - never used it though.

"everyone forgets a semi-colon sometimes." - Phaelax
Slayer267
14
Years of Service
User Offline
Joined: 6th Sep 2010
Location: Non of your beez wax
Posted: 27th Apr 2012 19:16
Well...


Print"I do know some basic, do you?"
Delay 5000
Input1=Input$("Well, DO YOU?!?!?!")
If input1=Yes Then
Input2=Input$("Good! Now is this a good start?")
If input2=Yes Then
Print "GOOD!!!!!!!!"
If Input2=No Then
Print"Awww man, all that time I wasted!"

Your signature has been erased by a mod; it needs to be no larger than 600x120.

Login to post a reply

Server time is: 2025-05-22 01:28:46
Your offset time is: 2025-05-22 01:28:46