Answers for "substring in string c"

C
2

check if string in string c

if(strstr(sent, word) != NULL) {
    /* ... */
}
Posted by: Guest on February-23-2020
4

c substring

char subbuff[5];
memcpy( subbuff, &buff[10], 4 );
subbuff[4] = '';
Posted by: Guest on March-19-2020
2

c substring

//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);
Posted by: Guest on June-21-2020

Code answers related to "C"

Browse Popular Code Answers by Language