// base class Worker, class Waiter, Singer
Waiter w_temp;
Singer s_temp;
Worker* pw[] = {&w_temp, &s_temp };
pw->Show(); // assume Show() is a virtual function, and Waiter and Singer class overrides it.
// Worker is a pure virtual function? can't instanciate, upper is not an instance, why not?
2.about exception:
//if I throw a error like [code]throw "justSomeStirng.";
catch(const char* s) // parameter must const, why?
[/code]
3.about vector:
1 2
std::vector<int> a;
std::cin >> a.at(i); // is this right? why?
Is there some member funcion for vector to acquire it's sum for vector<int>?
4. why some code use the 2 versions? can't just the first version(It's also works for const object)?
1 no idea what your worker function looks like
2 no idea what you are throwing
3 no, but you can use a for loop
4 const after a function tells the compiler that your function won't modify any private variables of the class
5 i would leave them to increase readability. If they are necessary: just try it?