| Thread Closed |
(C++) Not sure what the problem wants me to do. |
Share Thread |
| May10-10, 03:24 AM | #1 |
|
|
(C++) Not sure what the problem wants me to do.
I have this HW problem, but I cannot figure out what it wants me to do. I don't want anyone to solve it for me, just point me in the right direction.
Suppose that a class hierarchy has a virtual method print Code:
class C {
virtual void print( ostream& ) const;
};
Code:
out << p; What I don't understand is the out << p bit. Am I supposed to be able to do Code:
out << p; |
| May10-10, 04:11 AM | #2 |
|
Mentor
|
That is exactly what you are supposed to do.
You should probably make your overloaded function obey the semantics of the << operator as used with streams so that given two such objects p and q the following works: Code:
out << "Members of p:\n" << p << "\nMembers of q:\n" << q; |
| Thread Closed |
Similar discussions for: (C++) Not sure what the problem wants me to do.
|
||||
| Thread | Forum | Replies | ||
| General solution of initial value problem --dont understand problem is asking me?? | Calculus & Beyond Homework | 1 | ||
| Pulley problem involves Friction static and Kinetic problem | Introductory Physics Homework | 1 | ||
| Integral Word Problem EXACT PROBLEM Incluced | Calculus & Beyond Homework | 6 | ||
| One Kinematic Problem, One Pendulum Problem, One Wave Problem | Introductory Physics Homework | 7 | ||
| classic E&M problem: point charge and a charged sphere, how to analyze this problem | Advanced Physics Homework | 1 | ||