I'm trying to copy only a portion of a string (or char *) into another string (or another char *)
char * first_string = "Every morning I"
char * second_string = "go to the library, eat breakfast, swim."
char * final_string;
I would like to copy part of the second_string into the first_string.
For Example:
Every morning I eat breakfast.
What is the function that allows you to copy only a portion of a string, starting from a specific point in the string?
Note: I don't want to use string variables, but char *, or even char arrays, if possible.
I don't want to use string variables, but char *, or even char arrays, if possible.Why?char const*, btw. If your compiler isn't already warning you about that then you are not using the proper flags.<string.h>, but<string>.<string.h>has not been "the string header" since the mid-1990s, i.e. before C++ was even internationally standardised as a language. Strings are vastly and disproportionately easier, and if you were having trouble with them then you should focus on fixing those problems rather than creating myriad new ones for yourself.