| rkstengel (34) | |
|
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 | |
|
|
|
| Cubbi (1572) | |
It's juststd::copy(string_1 + i, string_1 + j, string_2);although memcpy/strcpy would also work | |
|
|
|
| andywestken (1950) | |
|
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. strncpy http://www.cplusplus.com/reference/cstring/strncpy/ Andy | |
|
|
|