overloading >> operator

This is a discussion on overloading >> operator within the C++ Programming forums, part of the General Programming Boards category; Code: class Property { public: Property(); void operator >>(Property p); private: char *owner[256]; }; Property::Property() {} Property:: operator >> (Property ...

  1. #1
    Registered User Diamonds's Avatar
    Join Date
    Oct 2002
    Posts
    68

    overloading >> operator

    Code:
    class Property {
    public:
     Property();
     void operator >>(Property p);
    private:
     char *owner[256];
    };
    
    Property::Property() {}
    
    Property:: operator >> (Property p) {
     cin>>owner;
    }
    
    int  main () {
     Property p;
     cin>>p;
    }
    This method is telling me that no operator for >> the class Property. Can someone please help me overload this operator, thnx.
    Last edited by Diamonds; 03-20-2003 at 11:46 PM.

  2. #2
    Registered User Diamonds's Avatar
    Join Date
    Oct 2002
    Posts
    68
    forget it, foudn it

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. unary operator overloading and classes
    By coletek in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2009, 01:14 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  3. Operator Overloading (Bug, or error in code?)
    By QuietWhistler in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2006, 07:38 AM
  4. C++ Operator Overloading help
    By Bartosz in forum C++ Programming
    Replies: 2
    Last Post: 08-17-2005, 12:55 PM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-06-2003, 11:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21