Problem

Jun 28, 2013 at 11:52am
Whenever I don't understand how to solve a C++-assignment from a book or from somewhere else, I just try to understand the solution and then I memorize it. Do you think that's a good way of learning the language? Because it happens to me quite often, that I don't know how to solve something.
Jun 28, 2013 at 12:25pm
Try to solve a problem, Even if your only using the basic's of C++.
More advanced technique's will come with time.

If your not sure how to go about solving a problem, Post the exercise in the forum, And you'll get some help.
Jun 28, 2013 at 12:27pm
Okay, but isn't that the same thing as looking at the solution? :)
Jun 28, 2013 at 12:39pm
It is but it's important to learn the "right way" to do something (by that I mean much easier and more error safe). So when posting a question, try to come up with the most specific question you can and post that, as opposed to the entire problem you're trying to solve.

As an example, I see too many people trying to use character arrays and getline, when they could be using string and the stream operator (>>). Which are so much easier but new people to the language don't know about them.
Jun 28, 2013 at 12:43pm
The point is, there isn't just a single solution. Even though some approaches might be clearly better than others, when you are learning, the important thing is to try to become familiar with multiple different ways of tackling problems.
Jun 28, 2013 at 1:10pm
I see. I also often begin working on something, but then I stop because I realize it is going to be too complex.
Last edited on Jun 28, 2013 at 1:11pm
Jun 28, 2013 at 3:27pm
In that case, you need to try and break down your task into smaller, self-contained subtasks. That way, you can write small, self-contained classes - or functions, if you're not comfortable with classes - that perform the tasks you require, and then put them together to build up the program you're trying to write.
Topic archived. No new replies allowed.