例如,我有这个
char *buff = "this is a test string";
并想得到"test"。我怎样才能做到这一点?
"test"
char subbuff[5]; memcpy( subbuff, &buff[10], 4 ); subbuff[4] = ‘\0’;
任务完成 :)