Skip to content

Instantly share code, notes, and snippets.

@annibuliful
Last active April 25, 2018 04:15
Show Gist options
  • Select an option

  • Save annibuliful/2eacec4c750c61d5e9f6edb51788b445 to your computer and use it in GitHub Desktop.

Select an option

Save annibuliful/2eacec4c750c61d5e9f6edb51788b445 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
int main(){
int i;
const char allData[3][100] = {"TutorialsPoint" , "Tuopoint" , "aws"};
char pattern[10];
char *ret;
scanf("%s" , pattern);
printf("[Result]\n\n");
for(i = 0 ; i < 3 ; i++ ){
ret = strstr(allData[i] , pattern);
if(ret != NULL){
printf("%s\n" ,allData[i]);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment