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.
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.
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.
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.