|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Code:
bool LinkedList::next()
{
Node *prev, *temp;
temp->ptr = static_cast<int>(prev->ptr) ^ static_cast<int>(current->ptr);
prev->ptr = current->ptr;
current->ptr = temp->ptr;
}
I keep getting the error: error C2296: '^' : illegal, left operand has type 'Node *' If this is totally wrong, can you just tell me how to do it, but it needs to be return type bool. The node class is defined as : Code:
class Node
{
public:
Node(){}
~Node(){}
// stores the value for the node
int value;
// stores both the next and previous pointers, combined with the xor operator
Node *ptr;
};
Last edited by jmurrayhead : February 11th, 2008 at 09:26 AM. |
|
#2
|
||||
|
||||
|
Quote:
Why are you doing this? Seems to me like all you have is a couple of munged pointers. Why does invoking Next on a linked list return a Boolean -- seems like it should return a pointer to the next node in the list or NULL if at the end of list?
__________________
Wolffy ------------------------ Teaching people to fish. Last edited by Wolffy : February 11th, 2008 at 12:31 PM. |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > C++ Help.. Double linked list |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|