   c++ and other things
  hello, i would like to know why everyone is so concerned about newbies like myself learning c++? i have started learning it and it just seems like another language to master. so whats the big deal?oh yeah and i would also like to ask, what is a game engine?   
  It's relatively complicated and requires you to manually keep track of quite a few things (whether you know it or not). There's certain behavior that's simply undefined by the language standard, so even though things seem to go well, they may not actually work they way you wanted them to. It's actually pretty tricky to use well.Aspects like those make it a rather unfriendly language for starters. Not impossible, but not the best either. I think the main arguments around here boil down to this: there's too much stuff that you need to keep in mind, which distracts you from learning how to program (programming is much more than learning how to use a programming language).   ;Quote:Original post by emforcehello, i would like to know why everyone is so concerned about newbies like myself learning c++? i have started learning it and it just seems like another language to master. so whats the big deal?Because it's incredibly easy to shoot yourself in the foot (or face, depending on where the gun is aimed).  There are lots of little things in C++ that are really easy to not know about or skip over when learning C++, which can cause huge problems later on.  There's also lots of undefined behavior in C++.  Just because something appears to be doing what you want it to doesn't necessarily mean you programmed it correctly.  It could blow up in your face tomorrow or three months later.  Here's an example; what's wrong with this code:std::string str = "Hello world!";const char* storage = str.c_str();str = "The answer is 42; it's always 42...";std::cout << storage << std::endl;std::cout << str << std::endl;[edit]ninja'd++;   ;  ehm...i couldn't really tell you yet :D but could it be the fact those pieces of text will merge together because no space will be between them or no new line and you could have used using std;that would have saved some time although you are not using all the features of std;but you could also have said using std::cout;using std::string;and stuff like that?   ;  probably written the most newbish reply possible there i have only learned very basic stuff   ;  Those aren't any of the problems.  The text will not merge together.  I could have said using namespace std (or some other form of the using declarative), but I didn't because I try to avoid using the using keyword as much as possible.  It helps eliminate naming conflicts, and I really don't mind saying std::.That code there is actually undefined behavior.  It might compile just fine and *appear* to work just fine, but it's not.  The C-style string returned by c_str() is only valid until the next non-const method is called on the std::string.  So when I said str = "The answer is 42; it's always 42..."; I invalidated storage and invoked undefined behavior when I tried to print storage out to the console.See, it's little things like this that make it so easy to write incorrect code.  It's also possible that you may not learn these little things for a really long time, way after you may have introduced the bug into your code base that you're currently using.And don't worry about the "newbish reply".  I understand you're just beginning and wish the best of luck to you.  Just realize that there are tons of little gotchas that you'll probably overlook and could potentially cause you a lot of headache. [smile]   ;  ok thanks for the example and answer :D i now know what people mean when they say these things. can anyone give me an answer as to what a game engine is in laymans terms   ;Quote:Original post by emforceok thanks for the example and answer :D i now know what people mean when they say these things.You're welcome :)Quote:Original post by emforcecan anyone give me an answer as to what a game engine is in laymans termsRead this.   ;Quote:Original post by emforcecan anyone give me an answer as to what a game engine is in laymans termsI would call it: "some code used in a number of games, without being too specific to a particular game".Whether a game needs a game engine, or whether a beginner to C++ needs to worry about game engines are different matters.;  the most valuable knowledge you gain from learning c/c++ is about memory management, although not needed in more modern languages it really helps at times, for example when trying to solve a bug.So go for it, it pays out eventually.std::string str = "Hello world!";const char* storage = str.c_str();str = "The answer is 42; it's always 42...";std::cout << storage << std::endl;std::cout << str << std::endl;i would say that the first cout either produces the same output as the second, or "Hello world!", depending on if there is enough memory for the second string available at the spot where str is first created. This is because std::string::c_str() only produces a pointer to the string in memory and doesn't copy it. correct me if i'm wrong.A game engine is a program or library to which you only have to complement your game logic (probably as code) and graphics and sound assets to get a complete game. All the low level stuff is already written.