I've been reading through the C++/CLI specification (partly out of curiosity, partly out of necessity), and it makes it sound as though indirection in the way K described is a real pain in the ass. I made the following alterations:
As far as a different route of implementation is concerned, I would rather make my current method work. I will need to know how to implement sorting in C++/CLI anyway, and this way I can change the sorting mechanism at my leisure.
Edit: The following change was made:
Code Select
void Swap(Node^ val1, Node^ val2) {
Node^ temp = val1;
val1->value = val2->value;
val2->value = temp->value;
}
This yields the following output:Quote6For some reason it changed all of the items with priorities into copies of the bottom-most item without a priority.
1
22
333
333
333
333
0
Press any key to continue . . .
As far as a different route of implementation is concerned, I would rather make my current method work. I will need to know how to implement sorting in C++/CLI anyway, and this way I can change the sorting mechanism at my leisure.
Edit: The following change was made:
Code Select
void Swap(Node^ val1, Node^ val2) {
Object^ temp = val1->value;
val1->value = val2->value;
val2->value = temp;
}
The change yielded the following output:Quote6It's getting closer.
Higher priority data.
333
3
22
1
1
0
Press any key to continue . . .