D
Don Hedgpeth
Here's a question - I'm new to c++ and I have two classes that overload the >> operator. One class calls the other...such as.
//code for class1
friend std::istream& operator >> (std::istream& lhs, class1& rhs) {
.....random code here
return lhs:}
//code for class2
private:
class1 jimbo;
friend std::istream& operator >> (std::istream& lhs, class2& rhs) {
lhs>>rhs.jimbo;
return lhs;}
This code gives me a compile error and I just cannot seem to figure it
out. I know that the line lhs>>rhs.jimbo; is incorrect, but I am clueless
as to why? Any hints? Thanks.
//code for class1
friend std::istream& operator >> (std::istream& lhs, class1& rhs) {
.....random code here
return lhs:}
//code for class2
private:
class1 jimbo;
friend std::istream& operator >> (std::istream& lhs, class2& rhs) {
lhs>>rhs.jimbo;
return lhs;}
This code gives me a compile error and I just cannot seem to figure it
out. I know that the line lhs>>rhs.jimbo; is incorrect, but I am clueless
as to why? Any hints? Thanks.