Thank you very much, people for your support. As a result, I started to understand better pointers.
@Salem Could you please advise, what should I use better instead of gets_s?
@Camel-man What input are you using for your test case? I am using just simple letters: asdfbnmjhjkjhkjh
@DedicatedGamer Thank you very much for your C++ code example


I am showing here a picture what I have now
How do pointers work-exampl-png