Thread: Overloaded << operator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    16

    Overloaded << operator

    Quick question. If I have a method to overload the << operator:
    Header:
    Code:
    ostream& operator <<(ostream &os, const Set &s);
    In the cpp:
    Code:
    ostream& operator <<(ostream &os, const Set &s)
    {
           //print to a file
    }
    Is this the correct way to do this? I have checked around and it says it's the right way to do it but I am still getting errors.
    Last edited by DivineSlayer936; 04-07-2007 at 10:38 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Problem using overloaded << operator
    By Zildjian in forum C++ Programming
    Replies: 5
    Last Post: 09-19-2004, 01:09 PM
  4. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-06-2003, 11:51 PM
  5. overloaded << operator doesnt work
    By Unregistered in forum C++ Programming
    Replies: 6
    Last Post: 04-21-2002, 04:20 AM