it is said you learn C++ mainly by practicing it, but tutorials provide no practice

I asked for complete tutorials for c++ and i got recommended this site: https://www.learncpp.com/
Plus i have books from isoc++ site and i was reading a bit from stroustrup book.
When i was reading about what these tutorials will teach me on learncpp.com there was it will provide practice programs. Because you learn mostly from practice obviously.

But as i go through this tutorials, there is 0 practice and only lots of technical details, which majority of them i won't remember at all. Obviously you have learn something before you can start programming, but as i was looking to next sections it is same, no practice, only deep technical details, which i won't remember from head, before i use them somewhere. So it doesn't make any sense these tutorials go against its claims.

Plus i know there is a lot of options to practice programming, even with minimal knowledge, there is a a lot of programs and excercises you can do, because i already did some from this site and others. So i want balance learning, because i think i am not getting anything from reading vast technical details, from which i will remember i don't know 20% or less. And i have no idea what i could do in c++.

Where do you get excercises to practice programming, because it depends on what you know. I tried to google some topics i know, but it finds excercise with combination of something i don't know. What i mean it is hard to find them. How do programmers, which learning get ideas what do to, i would like to practice something, but i have no idea what to do, or where to find excercise, because there are scarce and hard to find these that fit to your knowledge. Hope you get what i am saying.
Last edited on
The Stroustrup book (Programming: Principles and Practice Using C++) has exercises at the end of each chapter.

For example, chapter 11 has:
exercise 12. Reverse the order of characters in a text file. For example, asdfghjkl becomes lkjhgfdsa.
Warning: There is no really good, portable, and efficient way of reading a file backward.

exercise 13. Reverse the order of words (defined as whitespace-separated strings) in a file.
For example, Norwegian Blue parrot becomes parrot Blue Norwegian.
You are allowed to assume that all the strings from the file will fit into memory at once.
Okay i will try that out, thanks !
Plus i have books from isoc++ site and i was reading a bit from stroustrup book.


What books exactly?

IMO, reading a good book and doing all the exercises posed in that book is probably the best method to self learn C++.

When i was reading about what these tutorials will teach me on learncpp.com there was it will provide practice programs.

I hope you mean exercises not complete programs. Exercises should give you an objective that you must meet with a program you write. They should use information that was taught in the chapter (and previous chapters as well).

Beware of tutorials on the internet, there are more lousy tutorials than good, and plenty of outright incorrect tutorials.

Where do you get excercises to practice programming, because it depends on what you know.


There's your problem. You're artificially limiting yourself based on the examples you've seen in tutorials. Stop that. Try something that you don't know.
I hope you mean exercises not complete programs. Exercises should give you an objective that you must meet with a program you write. They should use information that was taught in the chapter (and previous chapters as well).


Yeah i meant exercises like to learn new concepts and practice them to do it right and see what doesn't work and learn from mistakes etc.

There's your problem. You're artificially limiting yourself based on the examples you've seen in tutorials. Stop that. Try something that you don't know.


Yeah i know and i am learning new things, problem is i need practice them to remember them and learn how to program.
Last edited on
Are you looking for inspiration? I can relate to that. Try something with networking; maybe with the SFML library so that you learn two things at once.
No i just want to learn c++ atm. I am looking for more exercise that i can do. So i will try stroustrup book, where are exercises said JLBorges.
it is said you learn C++ mainly by practicing it, but tutorials provide no practice

There is a lot of example code at Learn C++. Code that teaches the basics from the ground up.

Type the example code you see in the lessons and try to get the example code to compile. Sometimes you see only a partial snippet so you have to add additional code to get it to work.

The reference section here at CPlusPlus (and cppreference) has lots of code examples to show the basics of how to use a C++ feature.

For example, the code sample for a std::vector's constructor shows several examples of creating a vector:

http://www.cplusplus.com/reference/vector/vector/vector/

See some sample code somewhere and change the code to do something different. Getting errors -- and understanding what the errors are telling you as well as how to fix those errors -- is one of the best teaching methods you can do on your own.

The best way to really learn is write code. And write code, and write code.
> So i will try stroustrup book, where are exercises

Yes, yes. Do the drills and the exercises at the end of each chapter in the book. Diligently.
Topic archived. No new replies allowed.