خرید بک لینک

Vote count: -1

,         class Node
        {
        public:
            string m_label;
            list<Node *> m_adjacent;
        };

    int main()
    {
            Node tab[5];
            tab[0].m_label = "AWK";
            tab[1].m_label = "ASCII";
            tab[2].m_label = "Matery";
            tab[3].m_label = "2016";
            tab[4].m_label = "actor";

            map<string, Node> map;
            map[tab[0].m_label] = tab[0];
            map[tab[1].m_label] = tab[1];
            map[tab[2].m_label] = tab[2];
            map[tab[3].m_label] = tab[3];
            map[tab[4].m_label] = tab[4];

            Node * temp[4] = { &tab[1], &tab[2], &tab[3], &tab[4] };

            map[tab[0].m_label].m_adjacent.push_back(temp[0]);
            map[tab[0].m_label].m_adjacent.push_back(temp[1]);
            map[tab[0].m_label].m_adjacent.push_back(temp[2]);
            map[tab[0].m_label].m_adjacent.push_back(temp[3]);

            cout << map[tab[0].m_label].m_label << endl;
            cout << map[tab[0].m_label].m_adjacent.pop_front()->m_label << endl;
    }

Visual Studio 2013 don't want to compile this code. Why is that so? Compile error is: Error (active) expression must have pointer type and left of '->m_label' must point to class/struct/union/generic type

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 19 ارديبهشت 1395 ساعت: 1:37

صفحه بندی