1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

expected constructor, destructor...

Discussion in 'C++' started by webbiz, Aug 28, 2010.

  1. webbiz

    webbiz New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Greetings.

    I'm getting the following error while using Netbeans 6.9.1 on C++ code.

    ../GNU_iomanip.h:27: error: expected constructor, destructor, or type conversion before '&' token
    ../GNU_iomanip.h:27: error: expected `,' or `;' before '&' token



    This is the code:

    Code:
    //------------------------------------------------------------------------------
    //
    // GNU_iomanip.h
    //
    // Purpose:    
    //
    //    Temporaray implementation of ostream manipulators from the 
    //    C++ Standard Library, which are not contained in  
    //    as provided with GNU C++.
    //
    // Notes:
    //
    //   This software is protected by national and international copyright. 
    //   Any unauthorized use, reproduction or modificaton is unlawful and 
    //   will be prosecuted. Commercial and non-private application of the 
    //   software in any form is strictly prohibited unless otherwise granted
    //   by the authors.
    //   
    // (c) 1999 Oliver Montenbruck, Thomas Pfleger
    //
    //------------------------------------------------------------------------------
    
    #include 
    #include 
    
    namespace{
        
    ostream& left(ostream& os)
    {
        os.setf(ios::left ,ios::adjustfield);
        return os;
    };
    
    ostream& right(ostream& os){os.setf(ios::right,ios::adjustfield); return os;};
    ostream& fixed(ostream& os){os.setf(ios::fixed,ios::floatfield);  return os;};
    ostream& showpos  (ostream& os){os.setf(ios::showpos); return os;};
    ostream& noshowpos(ostream& os){os.unsetf(ios::showpos); return os;};
    
    }
    
    
    I don't know what it is trying to tell me.

    Any help?

    Thanks.
    Webbiz
     

Share This Page