accelerated-c++

Accelerated C++ exercise: combining a vector of strings

I've been reading Accelerated C++ and I have to say it's an interesting book. In chapter 6, I have to use a function from <algorithm> to concatenate from a vector<string> into a single string. I could use accumulate, but it doesn't help because string containers can only push_back characters. int main () { using namespace std; st...

(Accelerated C++)++

I just finished reading Accelerated C++. I completed all of the exercises and I am looking for another book to continue developing my knowledge and skills of C++. What is a good book to read after this one? In particular, is Essential C++ by Stanley Lippman a good follow up or is the overlap with Accelerated C++ too large? In your answe...

Beginner question - Loop invariants (Specifically Ch.3 of "Accelerated C++")

Hi - as I said, a complete beginner question here. I'm currently working my way through "Accelerated C++" and just came across this in chapter 3: // invariant: // we have read count grades so far, and // sum is the sum of the first count grades while (cin >> x) { ++count; sum += x; } The authors follow this by explaining t...

Accelerated C++ - Ch 13 & 14 - Is a handle the same thing as a smart pointer?

I'm just about done Koenig & Moo's Accelerated C++ and in Chapters 13 & 14 they lay out the idea and implementation of a few Handle classes (simple, shared, reference counted). The classes encpasulate a raw pointer and abstract the allocation / deallocation of dynamic objects away from the client code to avoid all the dangers of raw poi...

What's wrong with my program for "Write a program to count how many times each distinct word appears in its input using C++."

// Write a program to count how many times each distinct word appears in its input. #include <iostream> #include <string> #include <vector> int main() { // Ask for // and read the input words std::cout << "Please input your words: " << std::endl; std::vector<std::string> word_input; std::string word;...

Please explain the meaning of this question.

I am reading the AC++. When I have finished the chapter 5, I met a question 5-1. What I want to ask is not how to work it out, yet is the meaning of this question. I even can't catch what the author want me to do. Maybe just because I am fresh for coding~ Will you kind enough to explain the question for me? Thanks for your time~ :) ...