Copy part of char array to another !!!

I can't use string copy or mem copy because I need to copy in the middle.
i am iterating through a string, and when I get to the word i want, i need to copy that to a holding array. So from i to j for example.

char *string_1[50];
char *string_2[50];

string_2 = string_1[i-j] //copy from 10-15 for example
It's just
std::copy(string_1 + i, string_1 + j, string_2);
although memcpy/strcpy would also work
Your example is not in step with your question.

Are you dealing with a string (as your question states) or an array of strings, as per your example?

Depending on which you actually need, then strcpy, memcpy, or even strncpy might be of use.


Topic archived. No new replies allowed.