خرید بک لینک

Vote count: -1

I'm implementing an algorithm that involves a variation of BFS using Visual C++. The queue contains objects of type Node* which I am trying to access the members (left and right subtrees) of. For some reason, simply ruing the following code retus an error:

queue<Node*> aQueue;
aQueue.push(root);
cout << aQueue.front->left;// Error: left of '->data' must point tclass/struct/union/generic type   

If I'm trying to implement BFS with a queue in C++ and I need to access the members of the Node pointer at the front of the queue, what is the proper way to do it?

asked 2 mins ago

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 21 تير 1395 ساعت: 5:39

صفحه بندی