I have function which copies of array of integer into vector which is working fine with std::copy call but when I changed std::copy to std::memcpy its not working correctly. Can someone plz point out what I am doing wrong ?
void Walle_SSD1306::RadarD(uint8_t *RadarLL, uint8_t isFirstRadarLogo)
{
//Following two copy statement is working correctly
std::copy(
RadarLL+128
, RadarLL + 8192
, buffer.begin()+128
);
std::copy(
RadarLL+38
, RadarLL + 90
, buffer.begin()+38
);
//But when I change copy to memcpy following code is not working correctly
std::memcpy(
(buffer.begin()+128) , (RadarLL+128), (8192 - 128)*sizeof(uint8_t)
);
std::memcpy(
(buffer.begin()+38), (RadarLL+38), (52*sizeof(uint8_t))
);
//where buffer is...
std::vector<uint8_t> buffer;