Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 May 2012
Offline Last Active Jun 12 2012 05:10 PM

#4944221 Annoying Error when trying to get height of a binary tree, weird errors.

Posted by on 28 May 2012 - 08:51 PM

This looks just like the problem I had when I took a data structures class at Full Sail.
The problem is that you're taking in a constant but returning a reference (or vise versa) it's hard to tell since this is your BST.cpp and I can't see where you're calling it in main.cpp or wherever you do the calling. But to be honest, the best way to solve this is by switching around some constants.

but yeah, whenever you see an error that says "cannot convert from (something) to (something different) it generally means you put a different object type in a parameter, or a return value is different, or something not matching a function. Like, if a function returns an integer, and you set a char pointer to it. or if the first parameter of a function takes in a string, and you give it an unsigned short. Not that extreme, but you get the point.

Wish I could help more, but I'd need to see wherever you're calling getTreeheight.

#4944219 Where to start to program a game

Posted by on 28 May 2012 - 08:31 PM

For new C++ programmers, they should be encouraged to stay the hell away from C and instead learn idiomatic C++.

Second, C++ is a horrible first language, period. Don't believe me, read this scenario and be completely honest with yourself, "could you have found the problem?". That's because C++ is rife with this kind of crap and you will be dealing with it from day 1! People say it's stuff like memory management that make C++ difficult, but it's not, not really... it's stuff like this. The horrible linker, the lets support every single bloody edge case even if nobody is ever going to use them mindset, the piss poor standard libraries, the fact its actually 4 languages smashed together, the weight of a thousand legacy mistakes. All of those negatives may eventually be a positive ( except the linker, which just sucks ), but to someone starting out they all work together to make C++ a terrible terrible starting language.

C++ was my starting language and same with a number of people I know. It isn't really difficult. And it seems to me that this is more of a rant against a language. Shouldn't really scare someone from using a language like that. I'd say take some time to check out C++ till an intermediate level is reached and see if it's the right language or not. I mean, it IS an industry standard. Almost every Game Dev related degrees in colleges are also starting with C++. Yeah C++ can be difficult, but every language have war stories. When I started with C++, in about 4 months I ended up making an Assassin's Creed version of Pong using Direct2D with animated sprites, FMOD implementation, etc. Plenty of people get through C++ as their first language and the results are very positive. Also, understanding C++ makes using C a LOT easier. Implementing C functions in a C++ program gets some nice results with the wide variety of libraries and methods. I think using it as a starter language depends on two main things: 1) how much time you have and 2) why you want to make games. Since you're 15, I'm guessing other than high school, you have plenty of free time. So maybe learn another language first, then go to C++. With enough dedication you could probably be at least Intermediate at programming before you even hit 18! And why do you want to make games? Do you want to do is as a small hobby? I've found that Java or ActionScript(Flash) are good for just making a few quick and fun games. Or maybe you want to turn this into a career? In that case consider where your dreams take you. Mine took me to the multi-platform development. In that case, I went straight to C++ (then C#, then Java, but Java was just for fun). But maybe you don't want to focus ONLY on making games for PC/PS3/360/Wii, maybe you just want PC, well then you have a much larger choice (I enjoy C#, but I'm also a lover of Object Oriented Programming), but you could make flash games or web games (Java,ActionScript,HTML5, etc) or downloadable games(C++,C#,etc).

Or hey, you got some scripting under your belt at a young age, that's really impressive! I'd say be a boss and make an OS strictly for gaming using assembly language! lol.