29 lines
448 B
C
29 lines
448 B
C
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
|
||
|
int main (void) {
|
||
|
char haystack1[20] = "TutorialsPoint";
|
||
|
char needle1[10] = "Point";
|
||
|
char *ret1;
|
||
|
|
||
|
ret1 = strstr(haystack1, needle1);
|
||
|
|
||
|
printf("The substring is: %s\n", ret1);
|
||
|
|
||
|
|
||
|
printf("\n");
|
||
|
|
||
|
|
||
|
char haystack2[20] = "TutorialsPoint";
|
||
|
char needle2[10] = "Point";
|
||
|
char *ret2;
|
||
|
|
||
|
ret2 = ft_strstr(haystack2, needle2);
|
||
|
|
||
|
printf("The substring is: %s\n", ret2);
|
||
|
|
||
|
return(0);
|
||
|
}
|
||
|
|