First, I should note that
there is no single good way to learn, and chances are many people here will disagree with other people's suggestions. Even the most popular and well known C++ books made by Bjarne Stroustrup (he created C++) do not have 5 star ratings.
Additionally, all tutorials will have SOME flaws. Whether it be a single line of code the author shouldn't be using, the messy format of the code, how the author tells the reader to use something and they'll teach what it means later, etc.
There is no "perfect tutorial". There are definitely some tutorials you should avoid and some are better than others. But
if anyone claims there is a "perfect tutorial" then that's only from their perspective and not a fact.
If you're learning C++ as your first language I personally recommend the following. But
please note that I am a beginner myself, so my suggestions may not be the best. That said, I have spent a lot of time looking for good tutorials and these are the main ones that really helped me.
Please note though that most tutorials I've come across use "using namespace std;". This line of code basically makes the language easier to learn, read, and use. However, it isn't considered a good programming practice. For example, let's say you want to print "Hello world". Here are the differences when using "using namespace std;" and when you're not:
1 2 3 4 5 6 7 8
|
#include <iostream>
using namespace std;
int main() {
cout << "Hello world";
return 0;
}
|
1 2 3 4 5 6 7 8
|
#include <iostream>
// Notice there is no "using namespace std;" line.
int main() {
std::cout << "Hello world"; // Notice there is now "std::" before cout
return 0;
}
|
Personally, I'd recommend using the "using namespace std;" line while you're learning the main basics. Then once you've become a little more familiar with C++, I recommend stop using that line and start inserting "std::" wherever needed.
--------------------------------------------------------------
Anyways, here are some tutorials I recommend:
YouTube Playlists:
1.
https://www.youtube.com/playlist?list=PL318A5EB91569E29A
2.
https://www.youtube.com/playlist?list=PL6xSOsbVA1eYl_5aQUgxJYvJdzNBroGGy
3.
https://www.youtube.com/playlist?list=PL6xSOsbVA1eaxY06L5ZZJfDZSohwO6AKY
* Please note that this playlist is not official tutorials, but provides some C++ examples to gain a better understanding of concepts as you learn them, as most tutorials will only show you the basics and not give you in-depth examples.
YouTube Videos:
- Watching a "Full Course" video on C++ shouldn't be the only thing you use to learn C++. However, in my opinion it may be useful starting out.
1.
https://youtu.be/vLnPwxZdW4Y
Websites:
1.
https://www.pluralsight.com/paths/c-plus-plus
2.
https://www.mikedane.com/programming-languages/c++/
3.
https://docs.microsoft.com/en-us/cpp/cpp/cpp-language-reference?view=vs-2019
4.
http://www.cplusplus.com/doc/tutorial/
Textbooks:
-
https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
* Please note you can find C++ Primer online free here:
http://www.charleshouserjr.com/Cplus2.pdf
I know you asked about the
structure in which to learn things, not for sources. What I meant was all of these sources will likely have similar things to learn first. And if you don't have a place you're already learning from, they are some good places to start.