Calling class function from another class

Pages: 12
Thank you that helped me, i'll have to read it more in depth later. Im curious to know what lines in my code arent needed, and what makes it so bad other than the recursion. Because i dont see anything wrong with my program at all, and i think thats what the problem is...
Last edited on
Bump.
closed account (o3hC5Di1)
Ok i tried to re write it and it ended up looking very similar, i honestly dont know what to do, ive never been taught any different, actually ive never been taught how to structure programs at all. if that is even a teachable thing.


I can recommend Robert Lafore's Object Oriented Programming in C++ for that.

If you take all the comments you've had on this post in consideration there is a lot of material for you to work with and improve upon.

Sometimes it's best to walk away from a project and start another one - every time you do that you take more experience into the next one.

All the best,
NwN
Ok, well i guess the project was a bit too ambitious for me, but i still want to know what lines of my code didnt need to be there and why its so bad, after i find that out, i'll move on.
closed account (o3hC5Di1)
The main problem lies in that you're copying certain blocks of code a lot and using a lot of simple if statements evaluating the same variable.
When you do that, it means these blocks of code can usually be wrapped in a function, resulting in much cleaner code. Superfluous if statements on the same variable can sometimes be replaced by a switch() construct - which is more readable and efficient in those cases.

Everything else has been said and pointed out to you already, I really suggest you move on and take on another project.

All the best,
NwN
Topic archived. No new replies allowed.
Pages: 12