|
|
This basically covers the same ground as the C++ Primer, but does so in a quarter of its space. This is largely because it does not attempt to be an introduction to programming, but an introduction to C++ for people who've previously programmed in some other language. It has a steeper learning curve, but, for those who can cope with this, it is a very compact introduction to the language. (Historically, it broke new ground by being the first beginner's book to use a modern approach to teaching the language.) Despite this, the C++ it teaches is purely C++98. https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list |
Here’s a subjective and selective short-list of must-read C++ programming-by-example guides: Koenig and Moo, Accelerated C++, 336 pgs, Addison-Wesley, 2000, ISBN 0-201-70353-X. Lots of examples using the standard C++ library. Truly a programming-by-example book. Musser and Saini, STL Tutorial and Reference Guide, Second Edition, Addison-Wesley, 2001, ISBN 0-201-037923-6. Lots of examples showing how to use the STL portion of the standard C++ library, plus lots of nitty gritty detail. https://isocpp.org/wiki/faq/how-to-learn-cpp#prog-by-example-books |
|
|
|
|
double grade(double midterm, double final, const std::vector<double>& hw);
return grade(midterm, final, median(hw));
double median(std::vector<double> vec);
M'ok, what are the parameter types in the grade function? double, double and const std::vector. What is the return type of the median function? double. In the return statement in the grade function you are recursively calling grade with double, double and double. *BOMB-O!* |
This frere bosteth that he knoweth helle, And God it woot, that it is litel wonder; Freres and feendes been but lyte asonder. |
This friar boasts that he knows hell, And God knows that it is little wonder; Friars and fiends are seldom far apart. |
|
|
shouldn't someone start with C++11 ? |
C++17 and C++20 make little sense if someone doesn't know the basics. |
seeplus wrote: |
---|
they [the books] haven't been updated for newer versions of C++ and don't even cover C++11 - never mind C++20! |
I don't think all books about C++17 or C++20 will cover older topics |
What You Will Learn Begin programming with the C++20 standard (Just mentioning the use of C++20 doesn't mean it is exclusive C++20 only) Carry out modular programming in C++ (Not C++20 exclusive) Work with arrays and loops, pointers and references, strings, and more (Not C++20 exclusive) Write your own functions, types, and operators (Not C++20 exclusive) Discover the essentials of object-oriented programming (Not C++20 exclusive) Use overloading, inheritance, virtual functions, and polymorphism (Not C++20 exclusive) Write generic function and class templates, and make them safer using concepts (Not C++20 exclusive) Learn the ins and outs of containers, algorithms, and ranges (Not C++20 exclusive) Use auto type declarations, exceptions, move semantics, lambda expressions, and much more (Not C++20 exclusive) |