Skip to content

Instantly share code, notes, and snippets.

@Gikoskos
Created August 11, 2015 20:40
Show Gist options
  • Save Gikoskos/1377bf3e4dbf50cf7d58 to your computer and use it in GitHub Desktop.
Save Gikoskos/1377bf3e4dbf50cf7d58 to your computer and use it in GitHub Desktop.
char *str = "ab xy zx NN", *buf = "xx";
while (strcmp(str, "NN") != 0) {
if (str[0] == buf[0] && str[1] == buf[1]) {
printf("found!\n");
}
str = &str[3];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment