On 16/02/2011 13:29, Giovanni Dicanio wrote:
On 16/02/2011 13:21, Nandkumar T wrote:
Is there any simple way to append byte one array into another byte array in visual c++?
Do you mean this?
bytes.push_back( * some byte value here * );
BTW: if you mean appending a whole byte array to another one, you may want to try something like this:
std::vector<BYTE> arr1, arr2;
arr1.insert( arr1.end(), arr2.begin(), arr2.end() );
GiovanniWednesday, February 16, 2011 12:32 PM
El 16/02/2011 13:21, Nandkumar T escribió:> Hi>> Is there any simple way to append byte one array into another byte array> in visual c++?>If you mean plain C-style arrays (i.e. int MyArray[MY_SIZE]) I'm afraidyou'll have to do it "by hand" (reserve memory enough to hold botharrays, copy them to the new array, then free the old arrays if necessary).If you are using CArray or similar, you have the Append function to dojust that.And if you are using std::vector, which is, BTW, the best option in mostcases, you have the function insert, as Giovanni has pointed out.Wednesday, February 16, 2011 1:20 PM