Ok nooooow we're getting somewhere.
First some background.
One of stringstream's functions is to basically replace the C-style functionality of printf / scanf if you're familiar with that. In C, printf is for
output and scanf is for
input. In C++, there are istreams (for input), ostreams (for output), and iostreams (for both input and output). std::stringstream is an iostream. cout is an ostream.
The ostream cout is "backed by" your console's output window, in a manner of speaking. That means when you "write to" cout, the resulting string is displayed on your screen. You can't access it anymore and you can't change it. It's gone.
The iostream std::stringstream is backed by an actual string object. That means you write to an std::stringstream and you don't see anything, except that the text of whatever you put in it is stored in a string for you to do whatever you want with.
Because std::stringstream supports both input and output, and because it is backed by an actual string object, it provides a convenient way to do conversions between strings and numbers. Here's a very short snippet of code that converts a string to a double.
std::stringstream foo;
double d;
foo << "12.6"; //The backing string now contains the text "12.6", no conversion necessary
foo >> d; //The backing string is converted into a double, and d = 12.6 now.
Here's a short snippet of code that converts the other way.
std::stringstream foo;
std::string str;
foo << 12.6 //The backing string now contains the text "12.6", double->string conversion
foo >> str; //No conversion necessary, the backing string is simply copied into 'str'.
So basically, for your assignment, every single time your << operator is called, you need to:
a) create an std::stringstream
b) Write your argument into it
c) convert it to a temporary string
d) compute the arithmetic sum of all characters in that string and store it in a class member variable so that you're keeping a running tally
e) also keep a running tally of the total number of characters you've encountered so far.
Does this make sense at all?