[Solved] How to copy portions of an array into another array


There’s very few good reasons to use memcpy() in C++. If I understand what you’re asking correctly, here’s an example of how to do it using std::copy().

vector<char*> args(argc - 2);
copy(argv + 2, argv + argc, begin(args));

Live example.

11

solved How to copy portions of an array into another array