Skip to content
Snippets Groups Projects
Select Git revision
  • 08256e681ca958282c556749d6332bf473cf4251
  • master default
2 results

string-ops-15.c

Blame
  • Forked from Peter Gerwinski / hp
    361 commits behind the upstream repository.
    string-ops-15.c 295 B
    #include <stdio.h>
    #include <string.h>
    
    int main (void)
    {
      char buffer[100] = "";
      sprintf (buffer, "Die Antwort lautet: %d", 42);
      printf ("%s\n", buffer);
    
      char *answer = strstr (buffer, "Antwort");
      printf ("%s\n", answer);
      printf ("found at: %zd\n", answer - buffer);
    
      return 0;
    }