Created
April 26, 2018 21:08
-
-
Save eXpl0it3r/0e664bbb29dd7c8fb87d8a1149fc6238 to your computer and use it in GitHub Desktop.
std::copy vs std::memcpy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<algorithm> | |
#include<cstddef> | |
#include<cstring> | |
auto data = new std::byte[100]; | |
auto copy = new std::byte[100]; | |
int main() { | |
std::copy(data, data + 100, copy); | |
std::memcpy(copy, data, 100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment