Copy Buffer in reverse order.
-
Hi, I have buffer,i would like to store it to another buffer in a reverse order.I mean last byte of source buffer should be the first byte of destination buffer. can any one help me for this? Neha
-
BYTE buf1[100];
BYTE buf2[100];for (int x = 0; x < 100; x++)
{
= buf1[99 - x];
}HTH :) --- CPUA 0x5041 Sonork 100.11743 Chicken Little It may be that your sole purpose in life is simply to serve as a warning to others.
-
But in my case buffer is a memory pointer. Is there any api which copies the memory buffer is reverse order?
-
But in my case buffer is a memory pointer. Is there any api which copies the memory buffer is reverse order?
_strrev(), or in STL template<class BidirectionalIterator> inline void reverse(BidirectionalIterator first, BidirectionalIterator last) or
void reverse (BYTE *src, BYTE *dest, size_t size)
{ // copy the first size bytes from src to dest in reverse order
for (int x = 0; x < size; x++)
{
= src[size - 1 - x];
}
}--- CPUA 0x5041 Sonork 100.11743 Chicken Little It may be that your sole purpose in life is simply to serve as a warning to others.