Substring of char[] in c++

c++, char, substring

Solution

If you are allowed to modify `t`, you could set `t[j]` to `0` and then use `t + i` to get the substring.

If not, you are going to have to make a copy.

That said, why can't you just use `std::string` and save yourself the headache?

Problem

I have ``` char t[200]; cin.get(s, 200); int i = 5; int j = 10; ``` Is there any simple way to get `substriing(i,j)` from `t` beside copying every element seperately to the another array? No `strings` etc. just `char t[200]`.

Original source