0
#include <iostream>
#include <stack>

using namespace std;
class listSmall {
private:
    int index;
    listSmall* right;
    ListBig* self;
public:
    friend class ListBig;
    friend class Graph;
    explicit listSmall(int idx);
    //int getIndex();
    //void connectWithVertex(listSmall* b);
    //void disconnectFromVertex(int idx);
    //cell*getNeighbors();

};

class ListBig {
private:
    int index;
    listSmall* right;
    ListBig* down;
public:
    friend class Graph;
    friend class listSmall;
    explicit ListBig(int idx);
    void connectVertex(ListBig* s);
    listSmall* findRight(int idx);
};

ListBig* self; выдаёт ошибку - error: 'ListBig' does not name a type ListBig* self;

1

1 ответ 1

2

Объясните компилятору, что он еще встретит расшифровку этого имени, поместив строку

class ListBig;

перед строкой

class listSmall {

(forward declaration).

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.