Skip to content
Snippets Groups Projects
Select Git revision
  • d48edcd327479e7a230e1a34684f251a5cd47337
  • master default protected
  • 2018ws
  • 2017ws
  • 2016ws
5 results

string-ops-20.c

Blame
  • Forked from Peter Gerwinski / hp
    Source project has a limited visibility.
    string-ops-20.c 318 B
    #include <stdio.h>
    #include <string.h>
    
    int main (void)
    {
      char buffer[10] = "";
      sprintf (buffer, "Die Antwort lautet: %d", 42);
      printf ("%s\n", buffer);
    
      char *answer = strstr (buffer, "Bntwort");
      if (answer)
        printf ("found at: %zd\n", answer - buffer);
      else
        printf ("not found\n");
    
      return 0;
    }