Question: Consider the following code skeleton in C++: Explain why the compiler wont allow the second call. Give an example of bad things that could happen
Consider the following code skeleton in C++:

Explain why the compiler won’t allow the second call. Give an example of bad things that could happen if it did.
#include using std::1ist; class foo {... class bar : public foo { ... static void print_all(list &L) { .. list LF; list LB; print_all (LF); print_all (LB); // works fine // static semantic error
Step by Step Solution
3.52 Rating (166 Votes )
There are 3 Steps involved in it
Since every bar is a foo it is tempting to think that anything printall might do to elements of a ... View full answer
Get step-by-step solutions from verified subject matter experts
