Skip to content

Instantly share code, notes, and snippets.

@eXpl0it3r
Created April 26, 2018 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eXpl0it3r/0e664bbb29dd7c8fb87d8a1149fc6238 to your computer and use it in GitHub Desktop.
Save eXpl0it3r/0e664bbb29dd7c8fb87d8a1149fc6238 to your computer and use it in GitHub Desktop.
std::copy vs std::memcpy
#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