c substring
snippet in c

c substring

user9224

//where we want the word "test" and we know its position in the string
char *buff = "this is a test string";
printf("%.*s", 4, buff + 10);

c substring

user4222

char subbuff[5];
memcpy( subbuff, &buff[10], 4 );
subbuff[4] = '\0';