C - 字符串中的字符范围

Jay*_*Jay 2 c string text

是否有一个函数来获取文本字符串中的一系列字符或者我需要自己制作?

Gab*_*osa 6

这样的事情可能有所帮助

#include <string.h>
#include <stdlib.h>

main(){
  const char* from = "12345678";
  char *to = (char*) malloc(6);
  strncpy(to, from+2, 5);
}
Run Code Online (Sandbox Code Playgroud)

编辑:来源