Remove a substring in C given positions of substring

后端 未结 5 2053

Let\'s say I have a char *example that contains 20 chars. I want to remove every char from example[5] to example[10] and then fix up the a

5条回答
  •  情话喂你
    2021-01-29 00:25

    Any ideas?

    I would prepare a parallel array, copying all the characters from the source array but ignoring those characters in the range specified. Optionally, one can release the memory used by source array if it is not on stack.

提交回复
热议问题