Thread: "return function" doesn't work

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    66

    "return function" doesn't work

    here's my simplified codes:
    Code:
    class Drug
    {
               public:
                       Drug(): avai(0) {};
                       bool& get_avai()
                       {
                                return avai;
                       }
               protected:
                       bool avai;
    };
    
    if (somedrug.get_avai()) 
    {
                //do something
    }
    my compiler (Dev-C++) says " cannot convert Drug::get_avai()' to `

    how come?
    Last edited by Cris987; 03-02-2004 at 12:21 AM.
    An Unofficial Cristiano Ronaldo Website : Ronaldo 7

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. getline() don't want to work anymore...
    By mikahell in forum C++ Programming
    Replies: 7
    Last Post: 07-31-2006, 10:50 AM
  2. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  3. Problems in getting OpenGL to work
    By zonf in forum C Programming
    Replies: 5
    Last Post: 02-13-2006, 04:48 AM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  5. DLL __cdecl doesnt seem to work?
    By Xei in forum C++ Programming
    Replies: 6
    Last Post: 08-21-2002, 04:36 PM