У меня есть проблема при назначении следующего указателя элементов списка.
Источник:
Код: Выделить всё
#include
#include
#include
using namespace std;
//element of circular linked list
struct Node {
int data;
Node* next;
Node(int value) {
data = value;
next = nullptr;
}
};
int main()
{
vector peoples;
peoples.push_back(Node(1));
peoples.push_back(Node(2));
peoples[0]->next = peoples[1];
return 0;
}
c ++ operator -> или ->* Применяет к "узлу", не к типу указателя
*.>
Подробнее здесь: https://stackoverflow.com/questions/796 ... st-in-a-ve