If array is 100000 items and it needs to be swapped then you really should have that pointer. :rolleyes:Quote:
Originally Posted by Paul McKenzie
Printable View
If array is 100000 items and it needs to be swapped then you really should have that pointer. :rolleyes:Quote:
Originally Posted by Paul McKenzie
void*ptr =&Reference, :/Quote:
Originally Posted by Paul McKenzie
This won't do anything that you suggested. Why not see your suggestion through to the end? You will see it won't work.Quote:
Originally Posted by Mitsukai
How do you reseat the reference if you change the pointer, as you suggested should be done? Example:
Try to change the address of "data" in the SwapMe function to point to a different buffer. You can't. And also, you didn't address the big issue, and that is your suggestion is not a "heck of a lot faster" than what already has been posted. In fact, it could be a "heck of a lot slower".Code:void SwapMe(char &data, int size)
{
}
Regards,
Paul McKenzie