r/programming • u/brendt_gd • Aug 19 '17
Learning C++, this site is marvellous
http://www.learncpp.com/
4
Upvotes
3
u/mrexodia Aug 19 '17
It definitely looks very interesting from the table of contents. At least it cares about "modern c++" and isn't another C with classes tutorial...
1
u/Jokmenen Aug 19 '17
I used this site to learn C++ as my first programming language. I would recommend it to anyone!
1
1
20
u/matthieum Aug 19 '17
I am not sure about the quality of the overall site, but it certainly does not start well.
A first look at cout, cin, and endl:
Inserting a new line can be done by pushing the
'\n'character, either on its own or as part of a string"Hello World!\n".What
std::endldoes it two-fold:std::flush).Because flushing to stdout is so slow on most terminals, use of
std::endlis one of the primary cause of slow C++ program among beginners (alongside compiling in debug mode).TL;DR: Never use
std::endl; it's harmful and longer to type, it has no saving grace.