Thread: Error: Friends must be functions or classes

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    3

    Error: Friends must be functions or classes

    I have inherited some code which supposedly compiled with Borland C++ Builder 1.0. However, the following line:

    friend istream &operator>>(istream &stream, mol &ob);

    gives the error: Friends must be functions or classes

    Why istream is not being found as a class beats me.

    Anybody have any ideas?

    Thanks

  2. #2
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Make sure its in the current namespace. Looks like its having trouble with the 'operator>>' part by the error message. What compiler are you using now?
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array of classes?
    By dream_noir in forum C++ Programming
    Replies: 2
    Last Post: 03-22-2009, 11:43 AM
  2. Replies: 7
    Last Post: 11-17-2008, 01:00 PM
  3. Classes and member functions
    By uraliss in forum C++ Programming
    Replies: 2
    Last Post: 04-13-2006, 07:38 AM
  4. im extreamly new help
    By rigo305 in forum C++ Programming
    Replies: 27
    Last Post: 04-23-2004, 11:22 PM
  5. API "Clean Up" Functions & delete Pointers :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 05-10-2002, 06:53 PM