• 嵌套类可以先在外围类中声明,然后在外围类之外定义


    class List
    {
    public:
        int init( int );
    private:
        class ListItem;
    };

    class List::ListItem
    {
    public:     static int value;
        void  mf( const  List  &r);
        int  memb;
    };

    int List::ListItem::value;
    void List::ListItem::mf(const List &r)
    {   
    }
    int main()
    {
        return 0;
    }

  • 相关阅读:
    SCUT
    SCUT
    SCUT
    ???
    Codeforces
    SCUT
    SCUT
    SCUT
    SCUT
    2019牛客暑期多校训练营(第八场)
  • 原文地址:https://www.cnblogs.com/carbs/p/2432087.html
Copyright © 2020-2023  润新知