This example copies the substring of length 5 from the start of the source string to the destination char array. To make sure the destination string is properly terminated, a null character is added at the end of the string. Library: C++ Standard Library 2. Copying a substring from the middle of source string.c++
This example copies a substring of length 5 that starts at index 6 of the source string to the destination string. Library: C++ Standard Library 3. Handling cases where the source string is shorter than the specified length.c++ #include